struct
C0::Document
- C0::Document
- Struct
- Value
- Object
Overview
Zero-copy navigator for a full C0DATA document.
Walks an entire buffer containing FS/GS/RS/US structure and provides access to files, groups, records, and fields as slices into the original buffer.
Example: doc = C0::Document.new(buf) doc.name # => "mydb" doc.groups.size # => 2 doc.group("users") # => Group doc.group("users").table # => Table doc["users"] # => Group (shortcut)
Defined in:
c0/document.crConstructors
Instance Method Summary
-
#[](name : String) : Group
Shortcut for group by name.
-
#[](i : Int32) : Group
Shortcut for group by index.
-
#each_group(& : Group -> ) : Nil
Iterate all groups.
-
#group(i : Int32) : Group
Access a group by index.
-
#group(name : String) : Group
Access a group by name.
-
#group_count : Int32
Number of top-level groups.
-
#group_names : Array(Bytes)
All group names.
-
#name : Bytes
Document/file name (text after FS).