libCZI
Reading and Writing CZI documents made easy
Loading...
Searching...
No Matches
libCZI::CCziWriterInfo Class Reference

An implementation of the ICziWriterInfo-interface. More...

#include <libCZI_Write.h>

Inheritance diagram for libCZI::CCziWriterInfo:
libCZI::ICziWriterInfo

Public Member Functions

 CCziWriterInfo ()
 Default constructor - sets all information to "invalid" and sets fileGuid to GUID_NULL.
 
 CCziWriterInfo (const GUID &fileGuid, int mMin=1, int mMax=-1)
 
 CCziWriterInfo (const GUID &fileGuid, const IDimBounds &bounds, int mMin=1, int mMax=-1)
 
const IDimBoundsGetDimBounds () const override
 
const GUIDGetFileGuid () const override
 
bool TryGetMIndexMinMax (int *min, int *max) const override
 
bool TryGetReservedSizeForAttachmentDirectory (size_t *size) const override
 
bool TryGetReservedSizeForSubBlockDirectory (size_t *size) const override
 
bool TryGetReservedSizeForMetadataSegment (size_t *size) const override
 
void SetReservedSizeForAttachmentsDirectory (bool reserveSpace, size_t s)
 
void SetReservedSizeForSubBlockDirectory (bool reserveSpace, size_t s)
 
void SetReservedSizeForMetadataSegment (bool reserveSpace, size_t s)
 
void SetDimBounds (const IDimBounds *bounds)
 
void SetMIndexBounds (int mMin, int mMax)
 

Detailed Description

An implementation of the ICziWriterInfo-interface.

Constructor & Destructor Documentation

◆ CCziWriterInfo() [1/2]

libCZI::CCziWriterInfo::CCziWriterInfo ( const GUID fileGuid,
int  mMin = 1,
int  mMax = -1 
)
inlineexplicit

Constructor - leaves the bounds undefined.

Parameters
fileGuidThe GUID to be set as the CZI's file-guid. If this is GUID_NULL (all 0's), then we will create a new Guid and use it.
mMin(Optional) The minimum for the M-index (inclusive).
mMax(Optional) The maximum for the M-index (inclusive).

◆ CCziWriterInfo() [2/2]

libCZI::CCziWriterInfo::CCziWriterInfo ( const GUID fileGuid,
const IDimBounds bounds,
int  mMin = 1,
int  mMax = -1 
)
inline

Constructor.

Parameters
fileGuidThe GUID to be set as the CZI's file-guid. If this is GUID_NULL (all 0's), then we will create a new Guid and use it.
boundsThe bounds.
mMin(Optional) The minimum for the M-index (inclusive).
mMax(Optional) The maximum for the M-index (inclusive).

Member Function Documentation

◆ GetDimBounds()

const IDimBounds * libCZI::CCziWriterInfo::GetDimBounds ( ) const
inlineoverridevirtual

Gets bounds for the subblocks we are going to add to the CZI. If this is a valid bounds, then the coordinates of each subblock added are checked against this bounds. In case of a violation, an LibCZIWriteException-exception is thrown.

Returns
Null if the bounds is not specified, else the bounds for the subblock's coordinates we want to add.

Implements libCZI::ICziWriterInfo.

◆ GetFileGuid()

const GUID & libCZI::CCziWriterInfo::GetFileGuid ( ) const
inlineoverridevirtual

Gets file's unique identifier. If we report GUID_NULL, then the file-writer will create a GUID on its own.

Returns
The file's unique identifier.

Implements libCZI::ICziWriterInfo.

◆ SetDimBounds()

void libCZI::CCziWriterInfo::SetDimBounds ( const IDimBounds bounds)
inline

Sets the bounds. If null is specified, then we report "no valid bounds" with 'GetDimBounds()'.

Parameters
boundsThe bounds (may be nullptr).

◆ SetMIndexBounds()

void libCZI::CCziWriterInfo::SetMIndexBounds ( int  mMin,
int  mMax 
)
inline

Sets the M-index bounds. If mMax < mMin, then we report "no valid M-index-bounds" with 'TryGetMIndexMinMax'.

Parameters
mMinThe minimum value for the m-Index (inclusive).
mMaxThe maximum value for the m-Index (inclusive).

◆ SetReservedSizeForAttachmentsDirectory()

void libCZI::CCziWriterInfo::SetReservedSizeForAttachmentsDirectory ( bool  reserveSpace,
size_t  s 
)
inline

Sets reserved size for the "attachments directory".

Parameters
reserveSpaceTrue to reserve space.
sThe size (in bytes) to reserve for the "attachments directory".

◆ SetReservedSizeForMetadataSegment()

void libCZI::CCziWriterInfo::SetReservedSizeForMetadataSegment ( bool  reserveSpace,
size_t  s 
)
inline

Sets reserved size for the "metadata segment".

Parameters
reserveSpaceTrue to reserve space.
sThe size (in bytes) to reserve for the "metadata segment".

◆ SetReservedSizeForSubBlockDirectory()

void libCZI::CCziWriterInfo::SetReservedSizeForSubBlockDirectory ( bool  reserveSpace,
size_t  s 
)
inline

Sets reserved size for the "subblock directory".

Parameters
reserveSpaceTrue to reserve space.
sThe size (in bytes) to reserve for the "subblock directory".

◆ TryGetMIndexMinMax()

bool libCZI::CCziWriterInfo::TryGetMIndexMinMax ( int *  min,
int *  max 
) const
inlineoverridevirtual

Attempts to get the minimum and the maximum (inclusive) for the m-index. If returning a valid interval (ie. if the return value is true), then the M-coordinate of each subblock added is checked against this. Furthermore, in this case we require that all subblocks have a valid M-index.

Parameters
[out]minIf non-null will receive the minimum M-index (inclusive).
[out]maxIf non-null will receive the maximum M-index (inclusive).
Returns
True if it succeeds, false the is no bounds for the M-index.

Implements libCZI::ICziWriterInfo.

◆ TryGetReservedSizeForAttachmentDirectory()

bool libCZI::CCziWriterInfo::TryGetReservedSizeForAttachmentDirectory ( size_t *  size) const
inlineoverridevirtual

Query whether to reserve space for the attachment-directory-segment at the start of the file. If returning true, the value returned for size has the following meaning: if it is >0, it is interpreted as the number of attachment-entries (ie. how many attachments can be put into the CZI). If it is 0 (and returning true), some default is used. If returning false, no space is reserved, and the attachment-directory is put at the end of the CZI. If the reserved space is not sufficient, then the attachment-directory-segment is put at the end of the CZI (and the reserved space is unused).

Parameters
[out]sizeIf returning true, then this gives the number of attachment-entries to reserve.
Returns
True if space for the attachment-directory-segment is to be reserved, false otherwise.

Implements libCZI::ICziWriterInfo.

◆ TryGetReservedSizeForMetadataSegment()

bool libCZI::CCziWriterInfo::TryGetReservedSizeForMetadataSegment ( size_t *  size) const
inlineoverridevirtual

Query whether to reserve space for the metadata-segment at the start of the file. If returning true, the value returned for size has the following meaning: if it is >0, it is interpreted as the number of bytes available for the metadata-segment. If it is 0 (and returning true), some default is used. If returning false, no space is reserved, and the metadata-segment is put at the end of the CZI. If the reserved space is not sufficient, then the metadata-segment is put at the end of the CZI (and the reserved space is unused).

Parameters
[out]sizeIf returning true, then this gives the number of bytes to be reserved in the metadata-segment.
Returns
True if space (in bytes) for the metadata is to be reserved, false otherwise.

Implements libCZI::ICziWriterInfo.

◆ TryGetReservedSizeForSubBlockDirectory()

bool libCZI::CCziWriterInfo::TryGetReservedSizeForSubBlockDirectory ( size_t *  size) const
inlineoverridevirtual

Query whether to reserve space for the subblock-directory-segment at the start of the file. If returning true, the value returned for size has the following meaning: if it is >0, it is interpreted as the number of subblock-entries (ie. how many subblocks can be put into the CZI). If it is 0 (and returning true), some default is used. If returning false, no space is reserved, and the subblock-directory is put at the end of the CZI. If the reserved space is not sufficient, then the subblock-directory-segment is put at the end of the CZI (and the reserved space is unused).

Parameters
[out]sizeIf returning true, then this gives the number of subblock-entries to reserve.
Returns
True if space for the subblock-directory-segment is to be reserved, false otherwise.

Implements libCZI::ICziWriterInfo.


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