Exiv2
Loading...
Searching...
No Matches
List of all members
Exiv2::Internal::CiffDirectory Class Reference

This class models a CIFF directory of a CRW (Canon Raw data) image. More...

#include <crwimage_int.hpp>

Inheritance diagram for Exiv2::Internal::CiffDirectory:
Inheritance graph
[legend]

Public Member Functions

Creators
 ~CiffDirectory () override
 Virtual destructor.
 
 CiffDirectory (const CiffDirectory &)=delete
 
CiffDirectoryoperator= (const CiffDirectory &)=delete
 
- Public Member Functions inherited from Exiv2::Internal::CiffComponent
 CiffComponent ()=default
 Default constructor.
 
 CiffComponent (uint16_t tag, uint16_t dir)
 Constructor taking a tag and directory.
 
 CiffComponent (const CiffComponent &)=delete
 
CiffComponentoperator= (const CiffComponent &)=delete
 
virtual ~CiffComponent ()=default
 Virtual destructor.
 
void decode (Image &image, ByteOrder byteOrder) const
 Decode metadata from the component and add it to image.
 
void print (std::ostream &os, ByteOrder byteOrder, const std::string &prefix="") const
 Print debug info about a component to os.
 
void writeDirEntry (Blob &blob, ByteOrder byteOrder) const
 Write a directory entry for the component to the blob. If the size of the data is not larger than 8 bytes, the data is written to the directory entry.
 
uint16_t dir () const
 Return the tag of the directory containing this component.
 
uint16_t tag () const
 Return the tag of this component.
 
bool empty () const
 Return true if the component is empty, else false.
 
size_t size () const
 Return the data size of this component.
 
size_t offset () const
 Return the offset to the data from the start of the directory.
 
const bytepData () const
 Return a pointer to the data area of this component.
 
uint16_t tagId () const
 Return the tag id of this component.
 
TypeId typeId () const
 Return the type id of this component.
 
DataLocId dataLocation () const
 Return the data location for this component.
 
CiffComponentfindComponent (uint16_t crwTagId, uint16_t crwDir) const
 Finds crwTagId in directory crwDir, returning a pointer to the component or 0 if not found.
 
void add (UniquePtr component)
 Add a component to the composition.
 
CiffComponentadd (CrwDirs &crwDirs, uint16_t crwTagId)
 Add crwTagId to the parse tree, if it doesn't exist yet. crwDirs contains the path of subdirectories, starting with the root directory, leading to crwTagId. Directories that don't exist yet are added along the way. Returns a pointer to the newly added component.
 
void remove (CrwDirs &crwDirs, uint16_t crwTagId)
 Remove crwTagId from the parse tree, if it exists yet. crwDirs contains the path of subdirectories, starting with the root directory, leading to crwTagId.
 
void read (const byte *pData, size_t size, uint32_t start, ByteOrder byteOrder)
 Read a component from a data buffer.
 
size_t write (Blob &blob, ByteOrder byteOrder, size_t offset)
 Write the metadata from the raw metadata component to the binary image blob. This method may append to the blob.
 
size_t writeValueData (Blob &blob, size_t offset)
 Writes the entry's value if size is larger than eight bytes. If needed, the value is padded with one 0 byte to make the number of bytes written to the blob even. The offset of the component is set to the offset passed in.
 
void setDir (uint16_t dir)
 Set the directory tag for this component.
 
void setValue (DataBuf &&buf)
 Set the data value of the entry.
 

Manipulators

void readDirectory (const byte *pData, size_t size, ByteOrder byteOrder)
 Parse a CIFF directory from a memory buffer.
 

Additional Inherited Members

- Public Types inherited from Exiv2::Internal::CiffComponent
using UniquePtr = std::unique_ptr< CiffComponent >
 CiffComponent auto_ptr type.
 
using Components = std::vector< CiffComponent * >
 Container type to hold all metadata.
 
- Static Public Member Functions inherited from Exiv2::Internal::CiffComponent
static TypeId typeId (uint16_t tag)
 Return the type id for a tag.
 
static DataLocId dataLocation (uint16_t tag)
 Return the data location id for a tag.
 
- Protected Member Functions inherited from Exiv2::Internal::CiffComponent
void setSize (size_t size)
 Set the size of the data area.
 
void setOffset (size_t offset)
 Set the offset for this component.
 

Detailed Description

This class models a CIFF directory of a CRW (Canon Raw data) image.

Member Function Documentation

◆ readDirectory()

void Exiv2::Internal::CiffDirectory::readDirectory ( const byte pData,
size_t  size,
ByteOrder  byteOrder 
)

Parse a CIFF directory from a memory buffer.

Parameters
pDataPointer to the memory buffer containing the directory
sizeSize of the memory buffer
byteOrderApplicable byte order (little or big endian)

References Exiv2::Internal::CiffComponent::add(), Exiv2::directory, Exiv2::getULong(), Exiv2::getUShort(), Exiv2::Internal::CiffComponent::pData(), Exiv2::Internal::CiffComponent::size(), Exiv2::Internal::CiffComponent::tag(), and Exiv2::Internal::CiffComponent::typeId().


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