yaml

Generated by tinox doc

A dynamically-typed YAML value tree (YamlValue: string/int/float/bool/list/map) with a renderer (Yaml::stringify) that serializes it to indented YAML text. Note: Yaml::parse is currently a stub — it ignores its input and always returns an empty map, so YamlValue trees have to be built by hand (struct literals) rather than parsed from real YAML text yet.

Build and render

import tinox.core.yaml;

class Main
{
    fnc main() -> Int32
    {
        let name: YamlValue = YamlValue { kind: "string", stringValue: "tinox-central", intValue: 0, floatValue: 0.0, boolValue: false, listValue: [], mapValue: Map::new() };
        let port: YamlValue = YamlValue { kind: "int", stringValue: "", intValue: 8080, floatValue: 0.0, boolValue: false, listValue: [], mapValue: Map::new() };

        let root: Map<String, YamlValue> = Map::new();
        root["name"] = name;
        root["port"] = port;
        let doc: YamlValue = YamlValue { kind: "map", stringValue: "", intValue: 0, floatValue: 0.0, boolValue: false, listValue: [], mapValue: root };

        println(Yaml::stringify(doc));

        return 0;
    }
}

class Yaml

Methods

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

class YamlParser

Methods

fn parse(content: String) → YamlValue

class YamlRenderer

Methods

fn render(value: YamlValue, indent: Int64) → String
fn indent(level: Int64) → String

class YamlValue

Fields

kindString
stringValueString
intValueInt64
floatValueFloat64
boolValueBool
listValueList<YamlValue>
mapValueMap<String, YamlValue>

Methods

fn isString() → Bool
fn isInt() → Bool
fn isFloat() → Bool
fn isBool() → Bool
fn isList() → Bool
fn isMap() → Bool