Module convert_api

Module convert_api 

Source
Expand description

High-level APIs for bidirectional conversions between DcMstring and external documents.

§Architecture

Document conversion in Collective Toolbox is organized around [DcMstring] as the universal internal representation. Conversions are bidirectional:

  • Import: Converts external document formats (e.g. UTF-8, DcText, Dcts, Dcal, DcIntegerList, DcMixed, DcUtf, SEMS, Ascii, CscJournal) into [DcMstring].
  • Export: Serializes a [DcMstring] into any supported output format (SupportedDcOutputFormat).

§In-Memory Conversions

For whole documents in memory or files on disk:

§Streaming Conversions

For pipeline processing of documents and standard Unix pipelines:

§Format Detection

When FormatSpec::Auto is specified, format detection is delegated directly to the authoritative format detection engine in [ctb_formats_detection].

§Diagnostics and Logs

All conversions return a [ctb_formats_utilities::FormatLog] containing warnings, errors, and diagnostic notices generated during conversion.

Re-exports§

pub use crate::convert_bytes::DcConversionOptions;
pub use crate::convert_bytes::DcConversionResult;
pub use crate::convert_bytes::DcExportOptions;
pub use crate::convert_bytes::DcExportResult;
pub use crate::convert_bytes::FormatSpec;
pub use crate::convert_bytes::convert_bytes_to_dcmstring;
pub use crate::convert_bytes::convert_dcmstring_to_bytes;
pub use crate::convert_bytes::convert_dcmstring_to_file;
pub use crate::convert_bytes::convert_file_to_dcmstring;
pub use crate::convert_stream::StreamConversionReceipt;
pub use crate::convert_stream::StreamExportReceipt;
pub use crate::convert_stream::stream_dcmfile_to_writer;
pub use crate::convert_stream::stream_dcmreader_to_writer;
pub use crate::convert_stream::stream_file_to_dcmwriter;
pub use crate::convert_stream::stream_reader_to_dcmwriter;

Enums§

DcNormalizationMode
Policy for normalizing Document Characters and Unicode during conversion.
SupportedDcInputFormat
Document and text formats supported for conversion to Document Character String (DcMstring / DcString).
SupportedDcOutputFormat
Document and text formats supported for conversion from Document Character String (DcMstring / DcString).
SupportedDcTransformation
Document Character (Dc) transformations supported by the workspace.

Functions§

convert_cscjournal_to_dcmstring
Converts any in-memory cscjournal bytes (legacy or v4+) to a DcMstring document.
list_supported_input_formats
Returns the ordered list of all supported input formats for conversion to DcMstring.
list_supported_output_formats
Returns the ordered list of all supported output formats for conversion from DcMstring.
list_supported_transformations
Returns the ordered list of all supported document transformations.