25#include <libopenraw/consts.h>
26#include <libopenraw/debug.h>
28#include "memstream.hpp"
36MemStream::MemStream(
void *ptr,
size_t s)
46 m_current = (
unsigned char *)m_ptr;
62 if (m_current ==
nullptr) {
69 m_current = (
unsigned char*)m_ptr + offset;
73 m_current = (
unsigned char*)m_ptr + m_size + offset;
74 newpos = m_size + offset;
78 newpos = (m_current - (
unsigned char*)m_ptr);
90 if((m_current ==
nullptr) || (m_ptr ==
nullptr)) {
91 LOGDBG1(
"MemStream::failed\n");
95 unsigned char * end = (
unsigned char*)m_ptr + m_size;
96 if((off_t)count > (end - m_current)) {
97 count = end - m_current;
100 memcpy(buf, m_current, count);
106off_t MemStream::filesize()
virtual int close() override
virtual int read(void *buf, size_t count) override
virtual or_error open() override
virtual int seek(off_t offset, int whence) override
base virtual class for IO
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard....