libCZI
Reading and Writing CZI documents made easy
libCZI::IAttachmentRepository Class Referenceabstract

Interface for the attachment repository. This interface is used to access the attachments in a CZI-file. More...

#include <libCZI.h>

Inheritance diagram for libCZI::IAttachmentRepository:
libCZI::ICZIReader libCZI::ICziReaderWriter

Public Member Functions

virtual void EnumerateAttachments (const std::function< bool(int index, const AttachmentInfo &info)> &funcEnum)=0
 
virtual void EnumerateSubset (const char *contentFileType, const char *name, const std::function< bool(int index, const AttachmentInfo &info)> &funcEnum)=0
 
virtual std::shared_ptr< IAttachmentReadAttachment (int index)=0
 

Detailed Description

Interface for the attachment repository. This interface is used to access the attachments in a CZI-file.

Member Function Documentation

◆ EnumerateAttachments()

virtual void libCZI::IAttachmentRepository::EnumerateAttachments ( const std::function< bool(int index, const AttachmentInfo &info)> &  funcEnum)
pure virtual

Enumerate all attachments.

Parameters
funcEnumThe functor which will be called for every attachment. If the return value of the functor is true, the enumeration is continued, otherwise it is stopped. The first argument is the index of the attachment and the second is providing information about the attachment.

◆ EnumerateSubset()

virtual void libCZI::IAttachmentRepository::EnumerateSubset ( const char *  contentFileType,
const char *  name,
const std::function< bool(int index, const AttachmentInfo &info)> &  funcEnum 
)
pure virtual

Enumerate the subset of the attachments defined by the parameters.

Parameters
contentFileTypeIf non-null, only attachments with this contentFileType will be considered.
nameIf non-null, only attachments with this name will be considered.
funcEnumThe functor which will be called for every attachment (within the subset). If the return value of the functor is true, the enumeration is continued, otherwise it is stopped. The first argument is the index of the attachment and the second is providing information about the attachment.

◆ ReadAttachment()

virtual std::shared_ptr<IAttachment> libCZI::IAttachmentRepository::ReadAttachment ( int  index)
pure virtual

Reads the attachment identified by the specified index. If there is no attachment present (for the specified index) then an empty shared_ptr is returned. If a different kind of problem occurs (e. g. I/O error or corrupted data) an exception is thrown.

Parameters
indexIndex of the attachment (as reported by the Enumerate-methods).
Returns
If successful, the attachment object; otherwise an empty shared_ptr.

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