Document :: struct {
allocator: Allocator
nodes: [..] &Node
}
Document.create_node :: (d: &Document, name: [] u8) -> &Node
Document.query :: (d: &Document, query: [] u8) -> ? &Node
Document.query_all :: (d: &Document, query: [] u8) -> Iterator(&Node)
Node :: struct {
node: [] u8
type_annotation: ? [] u8
values: [..] Value
props: Map([] u8, Value)
children: [..] &Node
}
Node.add_value :: (n: &Node, value: Value.Value_Data) -> void
Node.query :: (n: &Node, query: [] u8) -> ? &Node
Node.query_all :: (n: &Node, query: [] u8) -> Iterator(&Node)
Node.set_prop :: (n: &Node, name: [] u8, value: Value.Value_Data) -> void
Node.value :: (n: &Node, index: i32) -> ? Value
Node.value_or_null :: (n: &Node, index: i32) -> Value
Value :: struct {
data: Value.Value_Data
type_annotation: ? [] u8
}
Value.as_bool :: (v: Value) -> ? bool
Value.as_float :: (v: Value) -> ? f64
Value.as_int :: (v: Value) -> ? i64
Value.as_str :: (v: Value) -> ? [] u8
KDL_Number :: union {
Integer: i64
Float: f64
String: [] u8
}
Parse_Error :: union {
None: void
Whitespace_Banned: void
Parser_Error: [] u8
}
free :: (d: Document) -> void
Releases all resources allocated for the document.
new_doc :: (allocator: Allocator) -> Document
Creates a new KDL document, using the allocator provided.
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 :: (d: &Document, query: [] u8) -> ? &Node
query :: (n: &Node, query: [] u8) -> ? &Node
query_all :: (d: &Document, query: [] u8) -> Iterator(&Node)
query_all :: (n: &Node, query: [] u8) -> Iterator(&Node)
query_doc :: (d: &Document, query: [] u8) -> ? &Node
query_doc_all :: (d: &Document, query: [] u8) -> Iterator(&Node)
query_node :: (n: &Node, query: [] u8) -> ? &Node
query_node_all :: (n: &Node, query: [] u8) -> Iterator(&Node)
write :: (d: &Document, w: &Writer) -> void
write_node :: (n: &Node, w: &Writer, indentation: i32) -> void
write_value :: (v: Value, w: &Writer) -> void