struct

C0::Document

Inherits Struct / Value / Object

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)

Constructors

new(buf : Bytes)
Source

Instance methods

[](name : String) : Group

Shortcut for group by name.

Source
[](i : Int32) : Group

Shortcut for group by index.

Source
each_group

Iterate all groups.

Source
group(i : Int32) : Group

Access a group by index.

Source
group(name : String) : Group

Access a group by name.

Source
group_count

Number of top-level groups.

Source
group_names

All group names.

Source
name

Document/file name (text after FS). Empty if no FS present.

Source