libopenraw
streamclone.hpp
1 /* -*- Mode: C++ -*- */
2 /*
3  * libopenraw - streamclone.h
4  *
5  * Copyright (C) 2006-2016 Hubert Figuière
6  *
7  * This library is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation, either version 3 of
10  * the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library. If not, see
19  * <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #ifndef OR_INTERNALS_IO_STREAMCLONE_H_
24 #define OR_INTERNALS_IO_STREAMCLONE_H_
25 
26 #include <stddef.h>
27 #include <sys/types.h>
28 
29 #include "stream.hpp"
30 
31 namespace OpenRaw {
32 namespace IO {
33 
37  : public Stream
38 {
39 public:
40  StreamClone(const Stream::Ptr &clone, off_t offset);
41  virtual ~StreamClone();
42 
43  StreamClone(const StreamClone& f) = delete;
44  StreamClone & operator=(const StreamClone&) = delete;
45 
46  virtual Error open() override;
47  virtual int close() override;
48  virtual int seek(off_t offset, int whence) override;
49  virtual int read(void *buf, size_t count) override;
50  virtual off_t filesize() override;
51 
52 private:
53 
54  Stream::Ptr m_cloned;
55  off_t m_offset;
56 };
57 
58 }
59 }
60 
61 #endif
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
Definition: arwfile.cpp:30
virtual int seek(off_t offset, int whence) override
Definition: streamclone.cpp:68
cloned stream. Allow reading from a different offset
Definition: streamclone.hpp:36
virtual int read(void *buf, size_t count) override
Definition: streamclone.cpp:83
virtual int close() override
Definition: streamclone.cpp:61
virtual Error open() override
Definition: streamclone.cpp:48
base virtual class for IO
Definition: stream.hpp:41