gsheet¶
#include <oead/gsheet.h>
For more information about Grezzo datasheets, refer to the wiki article.
Read-only API and binary format structs¶
This API is used to read binary datasheets efficiently.
In line with Nintendo’s naming conventions, structs that are directly used in the binary format have a Res prefix in their name.
-
struct
ResHeader
¶
-
struct
ResField
¶ Grezzo datasheet field (serialized).
Public Members
-
const char *
name
¶ Name (guaranteed to be non-null).
-
const char *
type_name
¶ Type name.
-
u8
x11
¶ Unknown; depth level?
-
u16
offset_in_value
¶ Offset of this field in the value structure.
-
u16
inline_size
¶ Size of this field in the value structure. For strings and arrays, this is always 0x10.
-
u16
data_size
¶ Size of the field data. For strings and inline types (inline structs, ints, floats, bools), this is the same as the size in the value structure.
-
const char *
-
class
Sheet
¶ Grezzo datasheet.
To actually access values that are stored in a binary datasheet, users are intended to define C++ structures and cast value pointers to the appropriate structure type.
See also SheetRw for a version of this class that allows for reflection and modifications.
Public Types
-
using
IntMap
= absl::flat_hash_map<int, void *>¶
-
using
StringMap
= absl::flat_hash_map<std::string_view, void *>¶
-
using
Utilities for defining datasheet structures¶
These are useful to define structures which datasheet values can be casted to.
-
template<typename
T
>
structNullable
¶ For defining datasheet structures.
Public Members
-
T *
data
= nullptr¶ Nullptr if no value.
-
T *
-
template<typename
T
>
structArray
¶ For defining datasheet structures.
-
struct
String
¶ For defining datasheet structures.
Read-write API¶
This API is used to read, modify and write binary datasheets. Datasheets can also be constructed from scratch.
-
struct
Field
¶ Grezzo datasheet field.
Public Types
Public Members
-
std::string
name
¶ Name (must not be empty).
-
std::string
type_name
¶ Type name.
-
u8
x11
¶ Unknown; depth level?
-
u16
offset_in_value
¶ Offset of this field in the value structure.
-
u16
inline_size
¶ Size of this field in the value structure. For strings and arrays, this is always 0x10.
-
u16
data_size
¶ Size of the field data. For strings and inline types (inline structs, ints, floats, bools), this is the same as the size in the value structure.
Friends
-
bool
operator==
(const Field &a, const Field &b)¶
-
std::string
-
struct
Data
¶ Represents a piece of field data in a datasheet.
Public Types
-
enum
Type
¶ Values:
-
Struct
¶
-
Bool
¶
-
Int
¶
-
Float
¶
-
String
¶
-
StructArray
¶
-
BoolArray
¶
-
IntArray
¶
-
FloatArray
¶
-
StringArray
¶
-
Null
¶
-
-
using
Null
= std::nullptr_t
-
using
Struct
= absl::flat_hash_map<std::string, Data> A struct is represented as a string to Value map, with the field names as keys.
-
using
Variant
= util::Variant<Type, std::unique_ptr<Struct>, bool, int, float, std::unique_ptr<std::string>, std::unique_ptr<std::vector<Struct>>, std::unique_ptr<std::vector<bool>>, std::unique_ptr<std::vector<int>>, std::unique_ptr<std::vector<float>>, std::unique_ptr<std::vector<std::string>>, Null>¶
-
enum