OpenRaw::Internals::RawContainer Class Reference

#include <rawcontainer.h>

Inheritance diagram for OpenRaw::Internals::RawContainer:

OpenRaw::Internals::CIFFContainer OpenRaw::Internals::IFDFileContainer OpenRaw::Internals::JFIFContainer OpenRaw::Internals::ORFContainer List of all members.

Public Types

 ENDIAN_NULL = 0
 ENDIAN_BIG
 ENDIAN_LITTLE
enum  EndianType { ENDIAN_NULL = 0, ENDIAN_BIG, ENDIAN_LITTLE }

Public Member Functions

 RawContainer (IO::Stream *_file, off_t offset)
virtual ~RawContainer ()
IO::Streamfile ()
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 &)
RawContaineroperator= (const RawContainer &)
void setEndian (EndianType endian)

Protected Attributes

IO::Streamm_file
off_t m_offset
EndianType m_endian

Detailed Description

Generic interface for the RAW file container

Definition at line 44 of file rawcontainer.h.


Member Enumeration Documentation

enum OpenRaw::Internals::RawContainer::EndianType

define the endian of the container

Enumerator:
ENDIAN_BIG  no endian found: means invalid file
ENDIAN_LITTLE  little endian found

Definition at line 48 of file rawcontainer.h.


Constructor & Destructor Documentation

OpenRaw::Internals::RawContainer::RawContainer ( IO::Stream _file,
off_t  offset 
)

Parameters:
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.


Member Function Documentation

size_t OpenRaw::Internals::RawContainer::fetchData ( void *  buf,
const off_t  offset,
const size_t  buf_size 
)

Fetch the data chunk from the file

Parameters:
buf the buffer to load into
offset the offset
buf_size the size of the data to fetch
Returns:
the size retrieved, <= buf_size likely equal

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().

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, 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, 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, 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, m_endian, and OpenRaw::IO::Stream::read().

Referenced by OpenRaw::Internals::CIFF::HeapFileHeader::readFrom(), and OpenRaw::Internals::CIFF::RecordEntry::readFrom().


Member Data Documentation

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.


The documentation for this class was generated from the following files:
Generated on Sat Jan 27 11:36:13 2007 for libopenraw by  doxygen 1.4.7