libopenraw
|
#include <rawcontainer.hpp>
Public Types | |
enum | EndianType { ENDIAN_NULL = 0, ENDIAN_BIG, ENDIAN_LITTLE } |
Public Member Functions | |
RawContainer (const IO::Stream::Ptr &_file, off_t offset) | |
virtual | ~RawContainer () |
const IO::Stream::Ptr & | file () |
EndianType | endian () const |
off_t | offset () const |
bool | readInt8 (const IO::Stream::Ptr &f, int8_t &v) |
bool | readUInt8 (const IO::Stream::Ptr &f, uint8_t &v) |
bool | readInt16 (const IO::Stream::Ptr &f, int16_t &v) |
bool | readInt32 (const IO::Stream::Ptr &f, int32_t &v) |
bool | readUInt16 (const IO::Stream::Ptr &f, uint16_t &v) |
bool | readUInt32 (const IO::Stream::Ptr &f, uint32_t &v) |
size_t | fetchData (void *buf, off_t offset, size_t buf_size) |
Protected Member Functions | |
RawContainer (const RawContainer &) | |
RawContainer & | operator= (const RawContainer &) |
void | setEndian (EndianType _endian) |
Protected Attributes | |
IO::Stream::Ptr | m_file |
off_t | m_offset |
EndianType | m_endian |
Generic interface for the RAW file container
Definition at line 38 of file rawcontainer.hpp.
define the endian of the container
Enumerator | |
---|---|
ENDIAN_BIG | no endian found: means invalid file |
ENDIAN_LITTLE | big endian found little endian found |
Definition at line 41 of file rawcontainer.hpp.
OpenRaw::Internals::RawContainer::RawContainer | ( | const IO::Stream::Ptr & | _file, |
off_t | offset | ||
) |
file | the stream to read from |
offset | the offset since starting the beginning of the file for the container |
Definition at line 36 of file rawcontainer.cpp.
References m_file.
|
virtual |
size_t OpenRaw::Internals::RawContainer::fetchData | ( | void * | buf, |
off_t | offset, | ||
size_t | buf_size | ||
) |
Fetch the data chunk from the file
buf | the buffer to load into |
offset | the offset |
buf_size | the size of the data to fetch |
Definition at line 176 of file rawcontainer.cpp.
References m_file.
Referenced by OpenRaw::RawFile::_getThumbnail(), OpenRaw::Internals::MRW::DataBlock::DataBlock(), OpenRaw::Internals::CIFF::RecordEntry::fetchData(), OpenRaw::Internals::NefFile::isCompressed(), OpenRaw::Internals::IfdEntry::loadData(), and OpenRaw::Internals::MRW::DataBlock::uint16_val().
bool OpenRaw::Internals::RawContainer::readInt16 | ( | const IO::Stream::Ptr & | f, |
int16_t & | v | ||
) |
Read an int16 following the m_endian set
Definition at line 75 of file rawcontainer.cpp.
References ENDIAN_LITTLE.
Referenced by OpenRaw::Internals::CIFF::Heap::Heap().
bool OpenRaw::Internals::RawContainer::readInt32 | ( | const IO::Stream::Ptr & | f, |
int32_t & | v | ||
) |
Read an int32 following the m_endian set
Definition at line 99 of file rawcontainer.cpp.
References ENDIAN_LITTLE.
Referenced by OpenRaw::Internals::MRW::DataBlock::DataBlock(), OpenRaw::Internals::IfdFileContainer::getDirectoryDataSize(), OpenRaw::Internals::CIFF::Heap::Heap(), OpenRaw::Internals::IfdFileContainer::locateDirsPreHook(), and OpenRaw::Internals::CIFF::ImageSpec::readFrom().
bool OpenRaw::Internals::RawContainer::readUInt16 | ( | const IO::Stream::Ptr & | f, |
uint16_t & | v | ||
) |
Read an uint16 following the m_endian set
Definition at line 126 of file rawcontainer.cpp.
References ENDIAN_LITTLE.
Referenced by OpenRaw::Internals::CRWFile::_getRawData(), OpenRaw::Internals::CIFF::RecordEntry::readFrom(), and OpenRaw::Internals::MRW::DataBlock::uint16_val().
bool OpenRaw::Internals::RawContainer::readUInt32 | ( | const IO::Stream::Ptr & | f, |
uint32_t & | v | ||
) |
Read an uint32 following the m_endian set
Definition at line 150 of file rawcontainer.cpp.
References ENDIAN_LITTLE.
Referenced by OpenRaw::Internals::CRWFile::_getRawData(), OpenRaw::Internals::CIFF::Heap::Heap(), OpenRaw::Internals::CIFF::ImageSpec::readFrom(), and OpenRaw::Internals::CIFF::RecordEntry::readFrom().
|
protected |
the file handle
Definition at line 86 of file rawcontainer.hpp.
Referenced by fetchData(), OpenRaw::Internals::IfdFileContainer::getDirectoryDataSize(), OpenRaw::Internals::IfdFileContainer::locateDirsPreHook(), RawContainer(), and ~RawContainer().
|
protected |
the offset from the beginning of the file
Definition at line 88 of file rawcontainer.hpp.
Referenced by OpenRaw::Internals::IfdFileContainer::locateDirsPreHook().