#include <rawcontainer.h>
Public Types | |
enum | EndianType { ENDIAN_NULL = 0, ENDIAN_BIG, ENDIAN_LITTLE } |
Public Member Functions | |
RawContainer (IO::Stream *_file, off_t offset) | |
virtual | ~RawContainer () |
IO::Stream * | file () |
EndianType | endian () const |
bool | readInt16 (IO::Stream *f, int16_t &v) |
bool | readInt32 (IO::Stream *f, int32_t &v) |
bool | readUInt16 (IO::Stream *f, uint16_t &v) |
bool | readUInt32 (IO::Stream *f, uint32_t &v) |
size_t | fetchData (void *buf, const off_t offset, const size_t buf_size) |
Protected Member Functions | |
RawContainer (const RawContainer &) | |
RawContainer & | operator= (const RawContainer &) |
void | setEndian (EndianType endian) |
Protected Attributes | |
IO::Stream * | m_file |
off_t | m_offset |
EndianType | m_endian |
Definition at line 44 of file rawcontainer.h.
define the endian of the container
ENDIAN_NULL | |
ENDIAN_BIG | no endian found: means invalid file |
ENDIAN_LITTLE | big endian found little endian found |
Definition at line 48 of file rawcontainer.h.
OpenRaw::Internals::RawContainer::RawContainer | ( | IO::Stream * | _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 38 of file rawcontainer.cpp.
References m_file, OpenRaw::IO::Stream::open(), and OpenRaw::IO::Stream::seek().
OpenRaw::Internals::RawContainer::~RawContainer | ( | ) | [virtual] |
destructor
Definition at line 48 of file rawcontainer.cpp.
References OpenRaw::IO::Stream::close(), and m_file.
bool OpenRaw::Internals::RawContainer::readInt16 | ( | IO::Stream * | f, | |
int16_t & | v | |||
) |
Read an int16 following the m_endian set
Definition at line 55 of file rawcontainer.cpp.
References ENDIAN_LITTLE, ENDIAN_NULL, m_endian, and OpenRaw::IO::Stream::read().
Referenced by OpenRaw::Internals::IFDDir::load(), and OpenRaw::Internals::IFDDir::nextIFD().
bool OpenRaw::Internals::RawContainer::readInt32 | ( | IO::Stream * | f, | |
int32_t & | v | |||
) |
Read an int32 following the m_endian set
Definition at line 84 of file rawcontainer.cpp.
References ENDIAN_LITTLE, ENDIAN_NULL, m_endian, and OpenRaw::IO::Stream::read().
Referenced by OpenRaw::Internals::IFDFileContainer::getDirectoryDataSize(), OpenRaw::Internals::IFDDir::load(), and OpenRaw::Internals::IFDDir::nextIFD().
bool OpenRaw::Internals::RawContainer::readUInt16 | ( | IO::Stream * | f, | |
uint16_t & | v | |||
) |
Read an uint16 following the m_endian set
Definition at line 119 of file rawcontainer.cpp.
References ENDIAN_LITTLE, ENDIAN_NULL, m_endian, and OpenRaw::IO::Stream::read().
Referenced by OpenRaw::Internals::CIFF::RecordEntry::readFrom().
bool OpenRaw::Internals::RawContainer::readUInt32 | ( | IO::Stream * | f, | |
uint32_t & | v | |||
) |
Read an uint32 following the m_endian set
Definition at line 148 of file rawcontainer.cpp.
References ENDIAN_LITTLE, ENDIAN_NULL, m_endian, and OpenRaw::IO::Stream::read().
Referenced by OpenRaw::Internals::CIFF::HeapFileHeader::readFrom(), and OpenRaw::Internals::CIFF::RecordEntry::readFrom().
size_t OpenRaw::Internals::RawContainer::fetchData | ( | void * | buf, | |
const off_t | offset, | |||
const 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 182 of file rawcontainer.cpp.
References m_file, OpenRaw::IO::Stream::read(), and OpenRaw::IO::Stream::seek().
Referenced by OpenRaw::Internals::CIFF::RecordEntry::fetchData().
IO::Stream* OpenRaw::Internals::RawContainer::m_file [protected] |
the file handle
Definition at line 100 of file rawcontainer.h.
Referenced by fetchData(), file(), OpenRaw::Internals::IFDFileContainer::getDirectoryDataSize(), RawContainer(), and ~RawContainer().
off_t OpenRaw::Internals::RawContainer::m_offset [protected] |
the offset from the beginning of the file
Definition at line 102 of file rawcontainer.h.