Module formats

Module formats 

Source
Expand description

EITE format compatibility module. Provides conversions and metadata for document character (Dc) arrays and external formats. This module supports parsing, converting, and serializing Dc arrays to and from various external formats, as well as providing metadata and handling warnings for import and export operations.

Import/export/tests support columns take two space-separated levels: ‘ ’ (e.g. ‘3 1’ or ‘2 0’), or blank for none: First value: general format support; second value: Dc document conversion support. -1=N/A 0=none 1=WIP 2=mostly, or fully for at least one version of a format with options (e.g. basic dialect) 3=complete implementation of format (general) / complete semantic roundtripping to Dc syntax (dc) 4=3+losslessly roundtrippable (for dc: preserving all info for unambiguous bit-for-bit reconstruction) 5=4+optional strict validation.

Modules§

ascii
ASCII text formatter and token serialization for EITE.
dcbasenb
dcBasenb encoding/decoding: pack arbitrary Dcs into Unicode PUA.
elad
ELAD (.elad / .emd) short-Dc ASCII document conversions.
html
HTML representation formatter and output encoder for EITE.
integer_list
Integer list formatting and delimited sequence encoder for EITE.
sems
SEMS format parser and exporter for EITE compatibility.
utf8
This implements conversion to and from UTF-8, as well as to and from the dcBasenb format (which is implemented as a private-use extension of UTF-8).

Structs§

DcOutputLanguage
PrefilterSettings
Supported “dct” / document transformations

Enums§

Format

Functions§

convert_formats
Wrapper performing in -> internal Dc -> out. Converts input document from one format to another via internal Dc representation.
dc_from_format
Attempt to map a single external-format chunk to a Dc.
dc_to_format
Convert a single Dc to output bytes (for the subset of formats that support a per-Dc conversion).
dca_from_format
Parse input bytes (in a given “format”) into a vector of Dc integers. Many formats are still TODO.
dca_to_format
Convert a Dc array into a target output format (serialized bytes). Returns a vector of bytes representing the Dc array in the specified output format.
export_warning
Add an export warning for a specific character index and problem description.
export_warning_unmappable
Add an export warning for an unmappable Dc value at a specific index.
format_get_variant_type
Get the variant type string for a variant format. Returns the underlying variant type (e.g., “unicodePua”) for a format that is a variant (e.g. “dcBasenb”).
format_is_any_language
Is the format a language, either human or programming?
format_is_human_language
Is the format a human language?
format_is_programming_language
Is the format a programming language?
format_is_variant
Returns true if the format is a variant (as opposed to a base format), false otherwise. Note that this seems to only return true for formats that are only variants, as opposed to things like character encodings that are variants in regard to the html format, but are also formats on their own terms.
format_supports_variant
Check if a format supports a specific variant. Returns true if the format can handle the specified variant, false otherwise.
format_supports_variant_type
Check if a format supports a given variant type. Returns true if the format can handle the specified variant type, false otherwise. Does NOT expect (or accept) v: prefix that in the type column, denotes a variant type.
get_export_extension
Produce an export filename extension for a format (mirrors JS). Returns the recommended file extension for the given format.
get_export_warnings
Retrieve and clear all export warnings from the state. Returns a vector of warning messages that were collected.
get_format_comments
Get comments for a format. Returns any additional comments or notes associated with the format.
get_format_dc_export_support
Get the Dc document export support value for a format. Returns an integer indicating the level of Dc document export support for the format.
get_format_dc_import_support
Get the Dc document import support value for a format. Returns an integer indicating the level of Dc document import support for the format.
get_format_export_support
Get the general export support value for a format. Returns an integer indicating the level of general export support for the format.
get_format_extension
Get the file extension for a format. Returns the default file extension associated with the format, if any.
get_format_id
Returns the internal ID used to reference the format.
get_format_import_support
Get the general import support value for a format. Returns an integer indicating the level of general import support for the format.
get_format_label
Get the label for a format. Returns a string label that summarizes the format, suitable for display in a UI.
get_format_metrics_type
Get the metrics type for a format. Returns a string indicating the metrics type (e.g., “character”, “internal-unicode”, “complex-dcBasenb”).
get_format_name
Get the display name for a format. Returns the user-friendly name of the format, suitable for display in a UI.
get_format_tests_status
Get the test status value for a format. Returns an integer indicating the test coverage status of the format.
get_format_type
Get the type string for a format. Returns a string indicating the type/category of the format (e.g., text, encoding, internal).
get_format_variant_types
Get the variant types for a format. Returns a list of variant types (e.g., “unicodePua”, or “encoding”) that the format supports. Will NOT include the v: prefix that appears to denote that a given type is exclusively a variant type in the Type column.
get_import_warnings
Retrieve and clear all import warnings from the state. Returns a vector of warning messages that were collected.
import_warning
Add an import warning for a specific character index and problem description.
is_format
Check if a format is known. Returns true if the format is recognized, false otherwise.
is_supported_input_format
Check if a format is a supported input format. Returns true if the format can be used as input for conversion, false otherwise.
is_supported_internal_format
Check if a format is a supported internal format. Returns true if the format is supported for internal processing, false otherwise.
is_supported_output_format
Check if a format is a supported output format. Returns true if the format can be used as output for conversion, false otherwise.
is_variant_type
Check if a string is a recognized variant type. Returns true if the variant type is one of the known types (“encoding” or “unicodePua”). Does NOT expect a v: prefix for variant types.
list_data_types
List formats used for storing arbitrary data (currently only basenb)
list_formats
List all supported formats. Returns a vector of format names that are supported for conversion.
list_input_formats
List all supported input formats. Returns a vector of format names that can be used as input for conversion.
list_internal_formats
List all supported internal formats. Returns a vector of format names that are supported for internal processing.
list_output_formats
List all supported output formats. Returns a vector of format names that can be used as output for conversion.
list_variants_for_format
List all variants that are available for the given format. Does NOT return v: prefix for variants.
normalize_format
Normalize a format name to its canonical representation. Currently, this converts “utf8” to “unicode” as they are functionally equivalent in this context.
with_default_log