yaml
Generated by tinox doc
tinox.core.yaml, split out of the bundled stdlib as a standalone tinox-central package.
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 YamlLine
Fields
indent | Int64 | |
content | String |
class YamlParser
Methods
fn parse(content: String) → YamlValue
fn tokenize(content: String) → List<YamlLine>
fn countIndent(raw: String) → Int64
fn stripComment(rest: String) → String
fn parseBlock(lines: List<YamlLine>, idxRef: List<Int64>, minIndent: Int64) → YamlValue
fn parseNestedValue(lines: List<YamlLine>, idxRef: List<Int64>, parentIndent: Int64) → YamlValue
fn parseMapping(lines: List<YamlLine>, idxRef: List<Int64>, mapIndent: Int64) → YamlValue
fn parseSequence(lines: List<YamlLine>, idxRef: List<Int64>, indent: Int64) → YamlValue
fn findColon(content: String) → Int64
fn stripQuotes(s: String) → String
fn parseScalarOrFlow(s: String) → YamlValue
fn parseFlow(s: String) → YamlValue
fn splitTopLevel(s: String, sep: String) → List<String>
fn parseScalar(raw: String) → YamlValue
fn unescapeDouble(s: String) → String
fn isIntLiteral(s: String) → Bool
fn isFloatLiteral(s: String) → Bool
class YamlRenderer
Methods
fn render(value: YamlValue, indent: Int64) → String
fn indent(level: Int64) → String
class YamlValue
Fields
kind | String | |
stringValue | String | |
intValue | Int64 | |
floatValue | Float64 | |
boolValue | Bool | |
listValue | List<YamlValue> | |
mapValue | Map<String, YamlValue> |
Methods
fn isString() → Bool
fn isInt() → Bool
fn isFloat() → Bool
fn isBool() → Bool
fn isList() → Bool
fn isMap() → Bool
fn isNull() → Bool
fn get(key: String) → YamlValue
fn has(key: String) → Bool
fn at(index: Int64) → YamlValue
fn len() → Int64
fn asString(fallback: String) → String
fnc ofNull() → YamlValue
fnc ofString(value: String) → YamlValue
fnc ofInt(value: Int64) → YamlValue
fnc ofFloat(value: Float64) → YamlValue
fnc ofBool(value: Bool) → YamlValue
fnc ofList(value: List<YamlValue>) → YamlValue
fnc ofMap(value: Map<String, YamlValue>) → YamlValue