|
|
| DataValue (bool v) |
|
| DataValue (int64_t v) |
|
| DataValue (double v) |
|
| DataValue (std::string v) |
|
| DataValue (toast::UID v, DataType kind) |
|
| DataValue (glm::vec2 v) |
|
| DataValue (glm::vec3 v, DataType kind) |
|
| DataValue (glm::vec4 v) |
|
auto | type () const noexcept -> DataType |
|
auto | isNull () const noexcept -> bool |
|
auto | isArray () const noexcept -> bool |
|
auto | isObject () const noexcept -> bool |
|
template<class T> |
| auto | as () const -> T |
|
template<class T> |
| auto | value () const -> std::optional< T > |
|
| operator bool () const |
|
| operator int64_t () const |
|
| operator int () const |
|
| operator float () const |
|
| operator double () const |
|
| operator std::string () const |
|
| operator toast::UID () const |
|
| operator glm::vec2 () const |
|
| operator glm::vec3 () const |
|
| operator glm::vec4 () const |
|
auto | operator[] (std::string_view key) -> DataValue & |
|
auto | operator[] (std::string_view key) const -> const DataValue & |
|
auto | contains (std::string_view key) const noexcept -> bool |
|
auto | operator[] (size_t index) -> DataValue & |
|
auto | operator[] (size_t index) const -> const DataValue & |
|
auto | size () const noexcept -> size_t |
|
auto | empty () const noexcept -> bool |
|
void | push (DataValue v) |
| | Array: appends an element.
|
|
void | set (std::string key, DataValue v) |
| | Object: inserts or replaces by key.
|
|
void | remove (std::string_view key) |
| | Object: removes a key (no-op if absent).
|
|
auto | items () -> ObjectMap & |
|
auto | items () const -> const ObjectMap & |
|
auto | operator= (bool v) -> DataValue & |
|
auto | operator= (int64_t v) -> DataValue & |
|
auto | operator= (int v) -> DataValue & |
|
auto | operator= (double v) -> DataValue & |
|
auto | operator= (float v) -> DataValue & |
|
auto | operator= (std::string v) -> DataValue & |
| void | appendTo (toml::table &tbl, const std::string &key) const |
| void | appendTo (toml::array &arr) const |
| auto | asTomlTable () const -> toml::table |
|
auto | toJson () const -> json_t |
|
|
static auto | makeArray () -> DataValue |
|
static auto | makeObject () -> DataValue |
|
static auto | fromToml (const toml::node &n, const SchemaField *field, const toml::table *root=nullptr) -> DataValue |
| | Parse a DataValue from a TOML node, using the schema field for type context.
|
|
static auto | fromObject (const toml::table &t, const std::vector< SchemaField > &fields, const toml::table *root=nullptr) -> DataValue |
| | Build an Object DataValue from a TOML table, guided by a field list.
|
| static auto | fromJson (const json_t &j, DataType hint=DataType::null) -> DataValue |
Typed value for TOML files.