Import with #import "std/toml_document".

TomlKind :: enum { Missing = 0; String = 1; Integer = 2; Float = 3; Bool = 4; DateTime = 5; Array = 6; Table = 7; }
TomlNode :: struct { kind: TomlKind; key: string; text: string; first: s32; last: s32; next: s32; count: s32; defined: bool; dotted: bool; sealed: bool; table_array: bool; }
TomlDocument :: struct { nodes: Vec(TomlNode); root: s32; error: string; error_at: s64; }
TomlKindOf :: (document: *TomlDocument, node: s32) -> TomlKind
TomlFirst :: (document: *TomlDocument, node: s32) -> s32
TomlNext :: (document: *TomlDocument, node: s32) -> s32
TomlCount :: (document: *TomlDocument, node: s32) -> s32
TomlMember :: (document: *TomlDocument, table: s32, key: string) -> s32
TomlKey :: (document: *TomlDocument, node: s32) -> string
TomlString :: (document: *TomlDocument, node: s32) -> string
TomlScalarText :: (document: *TomlDocument, node: s32) -> string

Validated source spelling of a numeric, boolean, or date/time scalar.

TomlBool :: (document: *TomlDocument, node: s32) -> (bool, bool)
TomlRead :: (document: *TomlDocument, text: string, max_bytes: s64) -> bool

Parse the complete UTF-8 document, bounded before allocation. On failure no partial tree is exposed (root = -1); error/error_at describe the first error. Increase max_bytes explicitly for larger documents. Depth is bounded at 128.

Source ↗ · All modules