24 #include "ciff/recordentry.hpp"
25 #include "ciffcontainer.hpp"
32 : length(0), offset(0)
41 RecordEntry::RecordEntry()
48 auto file = container->file();
49 auto endian = container->endian();
50 auto result_16 = container->
readUInt16(file, endian);
51 if (result_16.empty()) {
57 int pos = file->seek(0, SEEK_CUR);
58 container->
fetchData(inrecord.c_array(), pos, 8);
61 auto result_32 = container->
readUInt32(file, endian);
62 if (result_32.empty()) {
65 auto length = result_32.value();
66 result_32 = container->
readUInt32(file, endian);
67 if (result_32.empty()) {
70 auto offset = result_32.value();
108 return IFD::EXIF_FORMAT_BYTE;
110 return IFD::EXIF_FORMAT_ASCII;
112 return IFD::EXIF_FORMAT_SHORT;
114 return IFD::EXIF_FORMAT_LONG;
116 return IFD::EXIF_FORMAT_INVALID;
127 LOGASSERT(
type() == TYPE_ASCII);
129 size_t sz = this->
length();
const CIFFContainer * container() const
Return the containing container.
off_t offset() const
Return the offset from the begining of the container.
boost::array< uint8_t, 8 > InRec
boost::variant< InRec, InHeap > data
uint16_t exifType() const
uint32_t containerOffset(const Heap &heap) const
bool readFrom(const CIFFContainer *container)
size_t fetchData(Heap *heap, void *buf, size_t size) const
std::string getString(Heap &heap) const
Heap heap(Heap &h, const CIFFContainer *container) const
Option< uint32_t > readUInt32(const IO::Stream::Ptr &f, EndianType endian) const
Read an uint32 following the m_endian set.
Option< uint16_t > readUInt16(const IO::Stream::Ptr &f, EndianType endian) const
Read an uint16 following the m_endian set.
size_t fetchData(void *buf, off_t offset, size_t buf_size) const
Fetch the data chunk from the file.
Global namespace for libopenraw.