toonx library

Classes

DecodeOptions
Configuration options for decoding TOON format to Dart values.
EncodeOptions
Configuration options for encoding Dart values to TOON format.

Functions

decode(String input, {DecodeOptions options = const DecodeOptions()}) → dynamic
Decodes a TOON-formatted string back to a Dart value.
encode(dynamic value, {EncodeOptions options = const EncodeOptions()}) String
Encodes a Dart value to TOON (Token-Oriented Object Notation) format.
escapeString(String value) String
Escapes special characters in a string for TOON format.
flattenMap(Map<String, dynamic> map, String separator, [String prefix = '']) Map<String, dynamic>
Flattens a nested map into a single-level map with compound keys.
isValidIdentifier(String key) bool
Checks if a string is a valid TOON identifier.
looksLikeNumber(String value) bool
Checks if a string looks like a number.
needsQuoting(String value, String delimiter) bool
Checks if a string needs to be quoted in TOON format.
normalizeValue(dynamic value) → dynamic
Normalizes a value for TOON encoding.
parseValue(String value) → dynamic
Parses a string value to its appropriate Dart type.
quoteString(String value, String delimiter) String
Quotes a string if necessary for TOON format.
splitByComma(String value) List<String>
Splits a string by commas, respecting quoted strings.
splitByDelimiter(String value, String delimiter) List<String>
Splits a string by the specified delimiter.
toonToXml(String toonString, {DecodeOptions options = const DecodeOptions()}) String
Converts a TOON string to XML format.
toonToXmlBadgerfish(String toonString, {DecodeOptions options = const DecodeOptions()}) String
Converts a TOON string to XML format using Badgerfish convention.
toonToYaml(String toonString, {DecodeOptions options = const DecodeOptions()}) String
Converts a TOON string to YAML format.
unescapeString(String value) String
Unescapes special characters from a TOON string.
unflattenMap(Map<String, dynamic> flat, String separator) Map<String, dynamic>
Reconstructs a nested map from flattened keys.
unquoteString(String value) String
Removes quotes from a TOON string if present.
xmlToToon(String xmlString, {EncodeOptions options = const EncodeOptions()}) String
Converts an XML string to TOON format.
xmlToToonBadgerfish(String xmlString, {EncodeOptions options = const EncodeOptions()}) String
Converts an XML string to TOON format using Badgerfish convention.
yamlToToon(String yamlString, {EncodeOptions options = const EncodeOptions()}) String
Converts a YAML string to TOON format.

Typedefs

JsonValue = dynamic
Type alias for JSON-compatible values.

Exceptions / Errors

ToonException
Utility classes and functions for TOON encoding/decoding operations. Exception thrown during TOON encoding or decoding operations.