toml

Generated by tinox doc

A minimal TOML parser and serializer. Parses TOML text into a dynamically-typed TomlValue (tables, arrays, strings, ints, floats, bools) via Toml::parse, and renders a TomlValue back to TOML text via Toml::stringify. Note: nested [section] tables are recognized but key/value lines under a section are currently stored as flat top-level keys, not nested inside that section's table.

ModuleVersionGroup
string1.0.0tinox.core

Parse and read

import tinox.core.toml;

class Main
{
    fnc main() -> Int32
    {
        let content: String = "name = \"tinox-central\"\nport = 8080\ndebug = true\n";
        let value: TomlValue = Toml::parse(content);
        let table: Map<String, TomlValue> = value.asTable();

        println(table["name"].asString());
        println(table["port"].asInt().toString());
        println(table["debug"].asBool().toString());

        return 0;
    }
}

class Toml

Methods

fn parse(content: String) → TomlValue
fn stringify(value: TomlValue) → String

class TomlParser

Methods

fn parse(content: String) → TomlValue
fn parseValue(value: String) → TomlValue

class TomlRenderer

Methods

fn render(value: TomlValue) → String

class TomlValue

Fields

kindString
stringValueString
intValueInt64
floatValueFloat64
boolValueBool
tableValueMap<String, TomlValue>
arrayValueList<TomlValue>

Methods

fn isString() → Bool
fn isInt() → Bool
fn isFloat() → Bool
fn isBool() → Bool
fn isTable() → Bool
fn isArray() → Bool
fn asString() → String
fn asInt() → Int64
fn asFloat() → Float64
fn asBool() → Bool
fn asTable() → Map<String, TomlValue>
fn asArray() → List<TomlValue>