Expand description
GFF binary container support. GFF V3.2 binary reader and writer.
GFF is a typed, table-backed binary graph format used for most KotOR game
data objects (UTC, UTI, ARE, DLG, and others).
§Format Layout
+------------------------------+ 0x0000
| Header (56 bytes) |
| file_type + version + |
| offsets/counts for tables |
+------------------------------+ struct_offset
| Struct table |
| 12 bytes * struct_count |
+------------------------------+ field_offset
| Field table |
| 12 bytes * field_count |
+------------------------------+ label_offset
| Label table |
| 16 bytes * label_count |
+------------------------------+ field_data_offset
| Field data blob |
+------------------------------+ field_indices_offset
| Field indices array (u32) |
+------------------------------+ list_indices_offset
| List indices array (u32) |
+------------------------------+§Logical Data Model
Gff
`-- root GffStruct
`-- [GffField(label, GffValue)]
`-- nested structs/lists recursively reference tablesOffsets in struct and field records reference table locations or blob offsets depending on field type. This module keeps those rules explicit and validates all ranges before decoding.
Structs§
- Gff
- In-memory representation of a binary GFF file.
- GffField
- One labeled GFF field.
- GffLabel
- Canonicalized GFF field label.
- GffLocalized
String - CExoLocString payload.
- GffLocalized
Substring - One localized substring entry.
- GffStruct
- One GFF struct node.
Enums§
- GffBinary
Error - Errors produced while parsing or writing binary GFF data.
- GffLabel
Error - Error returned when constructing a
GffLabelfails validation. - GffValue
- Runtime value for one GFF field.
Constants§
- MAX_
GFF_ LABEL_ LEN - Maximum number of ASCII characters for a GFF field label.
Functions§
- read_
gff - Reads a binary GFF file from a reader.
- read_
gff_ from_ bytes - Reads a binary GFF file from bytes.
- write_
gff - Writes a GFF in binary V3.2 format.
- write_
gff_ to_ vec - Serializes a GFF to a byte vector.