26 #include "io/stream.hpp" 27 #include "libopenraw/consts.h" 29 #include "streamclone.hpp" 35 StreamClone::StreamClone(
const Stream::Ptr & clone,
37 : Stream(clone->get_path().c_str()),
38 m_cloned(clone), m_offset(offset)
43 StreamClone::~StreamClone()
50 if (m_cloned == NULL) {
51 set_error(OR_ERROR_CLOSED_STREAM);
52 return OR_ERROR_CLOSED_STREAM;
54 m_cloned->seek(m_offset, SEEK_SET);
70 if (m_cloned == NULL) {
71 set_error(OR_ERROR_CLOSED_STREAM);
74 if (whence == SEEK_SET) {
77 int new_pos = m_cloned->seek(offset, whence);
85 if (m_cloned == NULL) {
86 set_error(OR_ERROR_CLOSED_STREAM);
89 return m_cloned->read(buf, count);
93 off_t StreamClone::filesize()
95 if (m_cloned == NULL) {
96 set_error(OR_ERROR_CLOSED_STREAM);
99 return m_cloned->filesize() - m_offset;
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
virtual int seek(off_t offset, int whence) override
virtual int read(void *buf, size_t count) override
virtual int close() override
virtual Error open() override