pub struct CziWriter(/* private fields */);Expand description
writer object.
Implementations§
Source§impl CziWriter
impl CziWriter
Sourcepub fn create<S: AsRef<str>>(options: S) -> Result<Self, Error>
pub fn create<S: AsRef<str>>(options: S) -> Result<Self, Error>
Create a writer object for authoring a document in CZI-format. The options string is a JSON-formatted string, here is an example: \code { "allow_duplicate_subblocks" : true } \endcode
\param [out] writer_object If the operation is successful, a handle to the newly created writer object is put here. \param options A JSON-formatted zero-terminated string (in UTF8-encoding) containing options for the writer creation.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn init<S: AsRef<str>>(
&self,
output_stream: &OutputStream,
parameters: S,
) -> Result<(), Error>
pub fn init<S: AsRef<str>>( &self, output_stream: &OutputStream, parameters: S, ) -> Result<(), Error>
Initializes the writer object with the specified output stream object. The options string is a JSON-formatted string, here is an example: \code { "file_guid" : "123e4567-e89b-12d3-a456-426614174000", "reserved_size_attachments_directory" : 4096, "reserved_size_metadata_segment" : 50000, "minimum_m_index" : 0, "maximum_m_index" : 100 } \endcode
\param [out] writer_object If the operation is successful, a handle to the newly created writer object is put here. \param output_stream_object The output stream object to be used for writing the CZI data. \param parameters A JSON-formatted zero-terminated string (in UTF8-encoding) containing options for the writer initialization.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn add_sub_block(
&self,
add_sub_block_info: AddSubBlockInfo,
) -> Result<(), Error>
pub fn add_sub_block( &self, add_sub_block_info: AddSubBlockInfo, ) -> Result<(), Error>
Add the specified sub-block to the writer object. The sub-block information is provided in the ‘add_sub_block_info_interop’ structure.
\param writer_object The writer object. \param add_sub_block_info_interop Information describing the sub-block to be added.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn add_attachement(
&self,
add_attachment_info: AddAttachmentInfo,
) -> Result<(), Error>
pub fn add_attachement( &self, add_attachment_info: AddAttachmentInfo, ) -> Result<(), Error>
Add the specified attachment to the writer object. The attachment is provided in the ‘add_attachment_info_interop’ structure.
\param writer_object The writer object. \param add_attachment_info_interop Information describing the attachment to be added.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn write_metadata(
&self,
write_metadata_info: WriteMetadataInfo,
) -> Result<(), Error>
pub fn write_metadata( &self, write_metadata_info: WriteMetadataInfo, ) -> Result<(), Error>
Add the specified metadata to the writer object. The metadata is provided in the ‘write_metadata_info_interop’ structure.
\param writer_object Handle to the writer object to which the metadata will be added. \param write_metadata_info_interop Information describing the metadata to be added.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn close(&self) -> Result<(), Error>
pub fn close(&self) -> Result<(), Error>
inalizes the CZI (i.e. writes out the final directory-segments) and closes the file. Note that this method must be called explicitly in order to get a valid CZI - calling ‘libCZI_ReleaseWriter’ without a prior call to this method will close the file immediately without finalization.
\param writer_object Handle to the writer object that is to be closed.
\returns An error-code indicating success or failure of the operation.