| Exiv2

Loading...
Searching...
No Matches
Friends | List of all members
Exiv2::Internal::TiffDirectory Class Reference

This class models a TIFF directory (Ifd). It is a composite component of the TIFF tree. More...

`#include <tiffcomposite_int.hpp>`

Inheritance diagram for Exiv2::Internal::TiffDirectory:
[legend]

## Public Member Functions
Creators
| TiffDirectory (uint16_t tag, IfdId group, bool hasNext=true)
| Default constructor.
| ~TiffDirectory () override=default
| Virtual destructor.
NOT implemented
TiffDirectory & | operator= (const TiffDirectory &)=delete
| Assignment operator.
Accessors
bool | hasNext () const
| Return true if the directory has a next pointer.
Public Member Functions inherited from Exiv2::Internal::TiffComponent
constexpr | TiffComponent (uint16_t tag, IfdId group)
| Constructor.
virtual | ~TiffComponent ()=default
| Virtual destructor.
| TiffComponent (const TiffComponent &)=default
TiffComponent & | operator= (const TiffComponent &)=default
TiffComponent * | addPath (uint16_t tag, TiffPath &tiffPath, TiffComponent *pRoot, UniquePtr object=nullptr)
| Add a TIFF entry tag to the component. Components on the path to the entry are added if they don't exist yet.
TiffComponent * | addChild (UniquePtr tiffComponent)
| Add a child to the component. Default is to do nothing.
TiffComponent * | addNext (UniquePtr tiffComponent)
| Add a "next" component to the component. Default is to do nothing.
void | accept (TiffVisitor &visitor)
| Interface to accept visitors (Visitor pattern). Visitors can perform operations on all components of the composite.
void | setStart (const byte *pStart)
| Set a pointer to the start of the binary representation of the component in a memory buffer. The buffer must be allocated and freed outside of this class.
size_t | write (IoWrapper &ioWrapper, ByteOrder byteOrder, size_t offset, size_t valueIdx, size_t dataIdx, size_t &imageIdx)
| Write a TiffComponent to a binary image.
uint16_t | tag () const
| Return the tag of this entry.
IfdId | group () const
| Return the group id of this component.
byte * | start () const
| Return a pointer to the start of the binary representation of the component.
UniquePtr | clone () const
| Return an auto-pointer to a copy of itself (deep copy, but without any children). The caller owns this copy and the auto-pointer ensures that it will be deleted.
size_t | writeData (IoWrapper &ioWrapper, ByteOrder byteOrder, size_t offset, size_t dataIdx, size_t &imageIdx) const
| Write the IFD data of this component to a binary image. Return the number of bytes written. Components derived from TiffEntryBase implement this method if needed.
size_t | writeImage (IoWrapper &ioWrapper, ByteOrder byteOrder) const
| Write the image data of this component to a binary image. Return the number of bytes written. TIFF components implement this method if needed.
size_t | size () const
| Return the size in bytes of the IFD value of this component when written to a binary image.
size_t | count () const
| Return the number of components in this component.
size_t | sizeData () const
| Return the size in bytes of the IFD data of this component when written to a binary image. This is a support function for write(). Components derived from TiffEntryBase implement this method corresponding to their implementation of writeData().
size_t | sizeImage () const
| Return the size in bytes of the image data of this component when written to a binary image. This is a support function for write(). TIFF components implement this method corresponding to their implementation of writeImage().
virtual int | idx () const
| Return the unique id of the entry in the image.

## Protected Member Functions
Protected Creators
| TiffDirectory (const TiffDirectory &rhs)
| Copy constructor (used to implement clone()).
Protected Manipulators
TiffComponent * | doAddPath (uint16_t tag, TiffPath &tiffPath, TiffComponent *pRoot, TiffComponent::UniquePtr object) override
| Implements addPath(). The default implementation does nothing.
TiffComponent * | doAddChild (TiffComponent::UniquePtr tiffComponent) override
| Implements addChild(). The default implementation does nothing.
TiffComponent * | doAddNext (TiffComponent::UniquePtr tiffComponent) override
| Implements addNext(). The default implementation does nothing.
void | doAccept (TiffVisitor &visitor) override
| Implements accept().
size_t | doWrite (IoWrapper &ioWrapper, ByteOrder byteOrder, size_t offset, size_t valueIdx, size_t dataIdx, size_t &imageIdx) override
| Implements write(). Write the TIFF directory, values and additional data, including the next-IFD, if any, to the ioWrapper, return the number of bytes written.
Protected Accessors
TiffDirectory * | doClone () const override
| Internal virtual copy constructor, implements clone().
size_t | doWriteData (IoWrapper &ioWrapper, ByteOrder byteOrder, size_t offset, size_t dataIdx, size_t &imageIdx) const override
| This class does not really implement writeData(), it only has write(). This method must not be called; it commits suicide.
size_t | doWriteImage (IoWrapper &ioWrapper, ByteOrder byteOrder) const override
| Implements writeImage(). Write the image data of the TIFF directory to the ioWrapper by forwarding the call to each component as well as the next-IFD, if there is any. Return the number of bytes written.
size_t | doSize () const override
| Implements size(). Return the size of the TIFF directory, values and additional data, including the next-IFD, if any.
size_t | doCount () const override
| Implements count(). Return the number of entries in the TIFF directory. Does not count entries which are marked as deleted.
size_t | doSizeData () const override
| This class does not really implement sizeData(), it only has size(). This method must not be called; it commits suicide.
size_t | doSizeImage () const override
| Implements sizeImage(). Return the sum of the image sizes of all components plus that of the next-IFD, if there is any.
Protected Member Functions inherited from Exiv2::Internal::TiffComponent

## Friends
class | TiffEncoder
class | TiffDecoder

## Additional Inherited Members
Public Types inherited from Exiv2::Internal::TiffComponent
using | UniquePtr = std::unique_ptr<TiffComponent>
| TiffComponent auto_ptr type.
using | Components = std::vector<UniquePtr>
| Container type to hold all metadata.

## Detailed Description

This class models a TIFF directory (Ifd). It is a composite component of the TIFF tree.

## Member Function Documentation

## ◆ doAccept()

void Exiv2::Internal::TiffDirectory::doAccept | ( | TiffVisitor & | visitor | ) |
| override protected virtual

Implements accept().

Implements Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffVisitor::geTraverse, Exiv2::Internal::TiffVisitor::go(), Exiv2::Internal::TiffVisitor::visitDirectory(), Exiv2::Internal::TiffVisitor::visitDirectoryEnd(), and Exiv2::Internal::TiffVisitor::visitDirectoryNext().

## ◆ doAddChild()

TiffComponent * Exiv2::Internal::TiffDirectory::doAddChild | ( | TiffComponent::UniquePtr | tiffComponent | ) |
| override protected virtual

Implements addChild(). The default implementation does nothing.

Reimplemented from Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::TiffComponent().

## ◆ doAddNext()

TiffComponent * Exiv2::Internal::TiffDirectory::doAddNext | ( | TiffComponent::UniquePtr | tiffComponent | ) |
| override protected virtual

Implements addNext(). The default implementation does nothing.

Reimplemented from Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::TiffComponent().

## ◆ doAddPath()

TiffComponent * Exiv2::Internal::TiffDirectory::doAddPath | ( | uint16_t | tag,
|  | TiffPath & | tiffPath,
|  | TiffComponent * | pRoot,
|  | TiffComponent::UniquePtr | object )
| override protected virtual

Implements addPath(). The default implementation does nothing.

Reimplemented from Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::addChild(), Exiv2::Internal::TiffComponent::addNext(), Exiv2::Internal::TiffComponent::addPath(), Exiv2::Internal::TiffCreator::create(), Exiv2::Internal::TiffPathItem::extendedTag(), Exiv2::Internal::TiffPathItem::group(), Exiv2::Internal::Tag::next, Exiv2::Internal::TiffComponent::tag(), Exiv2::Internal::TiffPathItem::tag(), and Exiv2::Internal::TiffComponent::TiffComponent().

## ◆ doClone()

TiffDirectory * Exiv2::Internal::TiffDirectory::doClone | ( |  | ) | const
| nodiscard override protected virtual

Internal virtual copy constructor, implements clone().

Implements Exiv2::Internal::TiffComponent.

References TiffDirectory().

## ◆ doCount()

size_t Exiv2::Internal::TiffDirectory::doCount | ( |  | ) | const
| nodiscard override protected virtual

Implements count(). Return the number of entries in the TIFF directory. Does not count entries which are marked as deleted.

Implements Exiv2::Internal::TiffComponent.

## ◆ doSize()

size_t Exiv2::Internal::TiffDirectory::doSize | ( |  | ) | const
| nodiscard override protected virtual

Implements size(). Return the size of the TIFF directory, values and additional data, including the next-IFD, if any.

Implements Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::count().

## ◆ doSizeData()

size_t Exiv2::Internal::TiffDirectory::doSizeData | ( |  | ) | const
| nodiscard override protected virtual

This class does not really implement sizeData(), it only has size(). This method must not be called; it commits suicide.

Implements Exiv2::Internal::TiffComponent.

## ◆ doSizeImage()

size_t Exiv2::Internal::TiffDirectory::doSizeImage | ( |  | ) | const
| nodiscard override protected virtual

Implements sizeImage(). Return the sum of the image sizes of all components plus that of the next-IFD, if there is any.

Implements Exiv2::Internal::TiffComponent.

## ◆ doWrite()

size_t Exiv2::Internal::TiffDirectory::doWrite | ( | IoWrapper & | ioWrapper,
|  | ByteOrder | byteOrder,
|  | size_t | offset,
|  | size_t | valueIdx,
|  | size_t | dataIdx,
|  | size_t & | imageIdx )
| override protected virtual

Implements write(). Write the TIFF directory, values and additional data, including the next-IFD, if any, to the ioWrapper, return the number of bytes written.

Implements Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::count(), Exiv2::Internal::OffsetWriter::cr2RawIfdOffset, Exiv2::Internal::enforce(), Exiv2::Internal::TiffComponent::group(), Exiv2::Internal::groupName(), Exiv2::Internal::TiffComponent::idx(), Exiv2::l2Data(), Exiv2::Internal::IoWrapper::putb(), Exiv2::Internal::IoWrapper::setTarget(), Exiv2::Internal::TiffComponent::sizeData(), Exiv2::us2Data(), Exiv2::Internal::IoWrapper::write(), Exiv2::Internal::TiffComponent::writeData(), and Exiv2::Internal::TiffComponent::writeImage().

## ◆ doWriteData()

size_t Exiv2::Internal::TiffDirectory::doWriteData | ( | IoWrapper & | ioWrapper,
|  | ByteOrder | byteOrder,
|  | size_t | offset,
|  | size_t | dataIdx,
|  | size_t & | imageIdx ) const
| override protected virtual

This class does not really implement writeData(), it only has write(). This method must not be called; it commits suicide.

Implements Exiv2::Internal::TiffComponent.

## ◆ doWriteImage()

size_t Exiv2::Internal::TiffDirectory::doWriteImage | ( | IoWrapper & | ioWrapper,
|  | ByteOrder | byteOrder ) const
| override protected virtual

Implements writeImage(). Write the image data of the TIFF directory to the ioWrapper by forwarding the call to each component as well as the next-IFD, if there is any. Return the number of bytes written.

Implements Exiv2::Internal::TiffComponent.

References EXV_ERROR, Exiv2::Internal::TiffComponent::TiffComponent(), and Exiv2::Internal::TiffComponent::writeImage().

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

- tiffcomposite_int.hpp
- tiffcomposite_int.cpp