Packages

builtin
cbindgen
core
core.alloc
core.alloc.arena
core.alloc.atomic
core.alloc.debug
core.alloc.fixed
core.alloc.gc
core.alloc.heap
core.alloc.log
core.alloc.memwatch
core.alloc.pool
core.alloc.ring
core.arg_parse
core.array
core.avl_tree
core.bucket_array
core.conv
core.crypto
core.crypto.keys
core.doc
core.encoding
core.encoding.base64
core.encoding.csv
core.encoding.hex
core.encoding.json
core.encoding.kdl
core.encoding.osad
core.encoding.utf8
core.encoding.xml
core.hash
core.hash.md5
core.hash.sha1
core.hash.sha256
core.heap
core.intrinsics
core.intrinsics.atomics
core.intrinsics.onyx
core.intrinsics.types
core.intrinsics.wasm
core.io
core.io.binary
core.iter
core.js
core.list
core.map
core.math
core.memory
core.misc
core.net
core.os
core.random
core.set
core.slice
core.string
core.sync
core.test
core.thread
core.time
main
runtime
runtime.info
runtime.platform
runtime.vars
simd

package core.encoding.kdl

Document
Document :: struct {
    allocator: Allocator
    nodes: [..] &Node
}
Methods
Document.create_node
Document.create_node :: (d: &Document, name: [] u8) -> &Node
Document.query
Document.query :: (d: &Document, query: [] u8) -> ? &Node
Document.query_all
Document.query_all :: (d: &Document, query: [] u8) -> Iterator(&Node)
Node
Node :: struct {
    node: [] u8
    type_annotation: ? [] u8
    values: [..] Value
    props: Map([] u8, Value)
    children: [..] &Node
}
Methods
Node.add_value
Node.add_value :: (n: &Node, value: Value.Value_Data) -> void
Node.query
Node.query :: (n: &Node, query: [] u8) -> ? &Node
Node.query_all
Node.query_all :: (n: &Node, query: [] u8) -> Iterator(&Node)
Node.set_prop
Node.set_prop :: (n: &Node, name: [] u8, value: Value.Value_Data) -> void
Node.value
Node.value :: (n: &Node, index: i32) -> ? Value
Node.value_or_null
Node.value_or_null :: (n: &Node, index: i32) -> Value
Value
Value :: struct {
    data: Value.Value_Data
    type_annotation: ? [] u8
}
Methods
Value.as_bool
Value.as_bool :: (v: Value) -> ? bool
Value.as_float
Value.as_float :: (v: Value) -> ? f64
Value.as_int
Value.as_int :: (v: Value) -> ? i64
Value.as_str
Value.as_str :: (v: Value) -> ? [] u8
KDL_Number
KDL_Number :: union {
    Integer: i64
    Float: f64
    String: [] u8
}
Parse_Error
Parse_Error :: union {
    None: void
    Whitespace_Banned: void
    Parser_Error: [] u8
}
free
free :: (d: Document) -> void

Releases all resources allocated for the document.

new_doc
new_doc :: (allocator: Allocator) -> Document

Creates a new KDL document, using the allocator provided.

parse
parse :: (s: [] u8, allocator: Allocator) -> Result(Document, Parse_Error)
parse :: (r: &Reader, allocator: Allocator) -> Result(Document, Parse_Error)

Parses a string or io.Reader into a KDL document, using the allocator provided for internal allocations.

Call core.encoding.kdl.free to free the returned document.

query
query :: (d: &Document, query: [] u8) -> ? &Node
query :: (n: &Node, query: [] u8) -> ? &Node
query_all
query_all :: (d: &Document, query: [] u8) -> Iterator(&Node)
query_all :: (n: &Node, query: [] u8) -> Iterator(&Node)
query_doc
query_doc :: (d: &Document, query: [] u8) -> ? &Node
query_doc_all
query_doc_all :: (d: &Document, query: [] u8) -> Iterator(&Node)
query_node
query_node :: (n: &Node, query: [] u8) -> ? &Node
query_node_all
query_node_all :: (n: &Node, query: [] u8) -> Iterator(&Node)
write
write :: (d: &Document, w: &Writer) -> void
write_node
write_node :: (n: &Node, w: &Writer, indentation: i32) -> void
write_value
write_value :: (v: Value, w: &Writer) -> void