Class IAttachmentRepository#
Defined in File libCZI.h
Inheritance Relationships#
Derived Types#
public libCZI::ICZIReader
(Class ICZIReader)public libCZI::ICziReaderWriter
(Class ICziReaderWriter)
Class Documentation#
-
class IAttachmentRepository#
Interface for the attachment repository. This interface is used to access the attachments in a CZI-file.
Subclassed by libCZI::ICZIReader, libCZI::ICziReaderWriter
Public Functions
-
virtual int GetAttachmentCount() const = 0#
Gets the number of attachments available in the repository.
- Returns:
The attachment count.
-
virtual bool TryGetAttachmentInfo(int index, AttachmentInfo *info) const = 0#
Attempts to get the attachment information of the attachment with the specified index. If the specified index is not valid, then false is returned.
- Parameters:
index – Index of the attachment to query information for.
info – [out] If non-null and operation is successful, then the information is put here.
- Returns:
True if it succeeds; false otherwise.
-
virtual void EnumerateAttachments(const std::function<bool(int index, const AttachmentInfo &info)> &funcEnum) = 0#
Enumerate all attachments.
- Parameters:
funcEnum – The 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.
-
virtual void EnumerateSubset(const char *contentFileType, const char *name, const std::function<bool(int index, const AttachmentInfo &info)> &funcEnum) = 0#
Enumerate the subset of the attachments defined by the parameters.
- Parameters:
contentFileType – If non-null, only attachments with this contentFileType will be considered.
name – If non-null, only attachments with this name will be considered.
funcEnum – The 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.
-
virtual std::shared_ptr<IAttachment> ReadAttachment(int index) = 0#
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:
index – Index of the attachment (as reported by the Enumerate-methods).
- Returns:
If successful, the attachment object; otherwise an empty shared_ptr.
-
virtual ~IAttachmentRepository() = default#
-
virtual int GetAttachmentCount() const = 0#