libopenraw  0.3.7
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
OpenRaw::Internals::CIFF::RecordEntry Class Reference

A record entry from a CIFF Heap. More...

#include <recordentry.hpp>

Classes

struct  InHeap
 

Public Types

typedef boost::array< uint8_t, 8 > InRec
 

Public Member Functions

bool readFrom (const CIFFContainer *container)
 
size_t fetchData (Heap *heap, void *buf, size_t size) const
 
bool isHeap () const
 
CIFFType type () const
 
Heap heap (Heap &h, const CIFFContainer *container) const
 
uint32_t count () const
 
uint16_t exifType () const
 
uint32_t containerOffset (const Heap &heap) const
 
std::string getString (Heap &heap) const
 
bool inRecord () const
 
uint32_t length () const
 
uint32_t offset () const
 

Public Attributes

uint16_t typeCode
 
boost::variant< InRec, InHeapdata
 

Detailed Description

A record entry from a CIFF Heap.

Definition at line 68 of file recordentry.hpp.

Member Typedef Documentation

◆ InRec

typedef boost::array<uint8_t, 8> OpenRaw::Internals::CIFF::RecordEntry::InRec

Im record record (8 bytes)

Definition at line 112 of file recordentry.hpp.

Member Function Documentation

◆ containerOffset()

uint32_t OpenRaw::Internals::CIFF::RecordEntry::containerOffset ( const Heap heap) const

Offset from begining of container

Definition at line 120 of file recordentry.cpp.

References heap(), OpenRaw::Internals::CIFF::Heap::offset(), and offset().

◆ count()

uint32_t OpenRaw::Internals::CIFF::RecordEntry::count ( ) const

Number of unit count, derived from byte size

Definition at line 87 of file recordentry.cpp.

References length(), and type().

◆ exifType()

uint16_t OpenRaw::Internals::CIFF::RecordEntry::exifType ( ) const

Equivalent exif type

Definition at line 104 of file recordentry.cpp.

References type().

◆ fetchData()

size_t OpenRaw::Internals::CIFF::RecordEntry::fetchData ( Heap heap,
void *  buf,
size_t  size 
) const

fetch data define by the record from the heap

Parameters
heapthe heap to load from
bufthe allocated buffer to load into
sizethe size of the allocated buffer
Returns
the size actually fetched. MIN(size, this->length);

Definition at line 76 of file recordentry.cpp.

References OpenRaw::Internals::CIFF::Heap::container(), OpenRaw::Internals::RawContainer::fetchData(), heap(), OpenRaw::Internals::CIFF::Heap::offset(), and offset().

Referenced by OpenRaw::Internals::CRWFile::_getRawData(), and getString().

◆ getString()

std::string OpenRaw::Internals::CIFF::RecordEntry::getString ( Heap heap) const

Return a string stored in the record entry... if applicable

Definition at line 125 of file recordentry.cpp.

References fetchData(), heap(), length(), and type().

◆ heap()

Heap OpenRaw::Internals::CIFF::RecordEntry::heap ( Heap h,
const CIFFContainer container 
) const

◆ inRecord()

bool OpenRaw::Internals::CIFF::RecordEntry::inRecord ( ) const
inline

Return whether the data is in-record.

Definition at line 127 of file recordentry.hpp.

References OpenRaw::Internals::CIFF::STORAGELOC_MASK, and typeCode.

Referenced by length(), offset(), and readFrom().

◆ isHeap()

bool OpenRaw::Internals::CIFF::RecordEntry::isHeap ( ) const
inline

Tell if current record is a heap

Definition at line 88 of file recordentry.hpp.

References type().

◆ length()

uint32_t OpenRaw::Internals::CIFF::RecordEntry::length ( ) const
inline

Length of the data in the Heap

Returns
0 if the data is in record, otherwise the length in byte

Definition at line 134 of file recordentry.hpp.

References data, and inRecord().

Referenced by OpenRaw::Internals::CRWFile::_getRawData(), count(), getString(), heap(), and readFrom().

◆ offset()

uint32_t OpenRaw::Internals::CIFF::RecordEntry::offset ( ) const
inline

Offset of the data in the Heap

Returns
0 if the data in in-record. Otherwise the offset in the heap

Definition at line 145 of file recordentry.hpp.

References data, and inRecord().

Referenced by OpenRaw::Internals::CRWFile::_getRawData(), containerOffset(), fetchData(), heap(), and readFrom().

◆ readFrom()

bool OpenRaw::Internals::CIFF::RecordEntry::readFrom ( const CIFFContainer container)

load record from container

Parameters
containerthe container
Returns
true if success

Definition at line 46 of file recordentry.cpp.

References data, OpenRaw::Internals::RawContainer::fetchData(), inRecord(), length(), offset(), OpenRaw::Internals::RawContainer::readUInt16(), OpenRaw::Internals::RawContainer::readUInt32(), and typeCode.

◆ type()

CIFFType OpenRaw::Internals::CIFF::RecordEntry::type ( ) const
inline

Type of current record CIFFType

Definition at line 94 of file recordentry.hpp.

References OpenRaw::Internals::CIFF::FORMAT_MASK, and typeCode.

Referenced by count(), exifType(), getString(), and isHeap().

Member Data Documentation

◆ data

boost::variant<InRec, InHeap> OpenRaw::Internals::CIFF::RecordEntry::data

Actual data of the record

Definition at line 155 of file recordentry.hpp.

Referenced by length(), offset(), and readFrom().

◆ typeCode

uint16_t OpenRaw::Internals::CIFF::RecordEntry::typeCode

type code of the record

Definition at line 153 of file recordentry.hpp.

Referenced by inRecord(), readFrom(), and type().


The documentation for this class was generated from the following files: