One element of a DataArray, as a compiled DataArray file stores it.
More...
#include <datanode.h>
|
| enum class | Type : std::uint8_t { Int = 0
, Symbol = 1
, Float = 2
, Array = 3
} |
| | Kind of element, numbered as the two-bit tags of the compiled file. More...
|
|
| bool | isKeyed (std::string_view key) const |
| | Report whether the element is an array whose first element is a symbol.
|
| DataNode * | findArray (std::string_view key) |
| | Find a child array by the symbol that opens it, the way DataArray::FindArray does.
|
| const DataNode * | findArray (std::string_view key) const |
| | Find a child array by the symbol that opens it, the way DataArray::FindArray does.
|
| int | indexOf (std::string_view key) const |
| | Find the index of a child array by the symbol that opens it.
|
| template<typename Map> |
| void | remapFiles (const Map &map) |
| | Change the file index of the element and of every array below it.
|
| bool | operator== (const DataNode &other) const =default |
| | Compare two elements, their kinds, values, and arrays.
|
One element of a DataArray, as a compiled DataArray file stores it.
A symbol and a quoted string share one kind, because the compiled file does not tell them apart.
◆ Type
Kind of element, numbered as the two-bit tags of the compiled file.
| Enumerator |
|---|
| Int | A 32-bit integer.
|
| Symbol | A symbol or a string.
|
| Float | A 32-bit float.
|
| Array | A nested array.
|
◆ makeInt()
| DataNode Tools::Ark::DataNode::makeInt |
( |
std::int32_t | value | ) |
|
|
static |
Make an integer element.
- Parameters
-
- Returns
- The element.
◆ makeSymbol()
| DataNode Tools::Ark::DataNode::makeSymbol |
( |
std::string | symbol | ) |
|
|
static |
Make a symbol element.
- Parameters
-
| symbol | The symbol or string. |
- Returns
- The element.
◆ makeFloat()
| DataNode Tools::Ark::DataNode::makeFloat |
( |
float | value | ) |
|
|
static |
Make a float element.
- Parameters
-
- Returns
- The element.
◆ makeArray()
| DataNode Tools::Ark::DataNode::makeArray |
( |
std::uint16_t | line, |
|
|
std::int32_t | file ) |
|
static |
Make an empty array element.
- Parameters
-
| line | Source line. |
| file | Index of the source file in the file table. |
- Returns
- The element.
◆ isKeyed()
| bool Tools::Ark::DataNode::isKeyed |
( |
std::string_view | key | ) |
const |
|
nodiscard |
Report whether the element is an array whose first element is a symbol.
- Parameters
-
- Returns
- Whether the first element is the symbol.
◆ findArray() [1/2]
| DataNode * Tools::Ark::DataNode::findArray |
( |
std::string_view | key | ) |
|
Find a child array by the symbol that opens it, the way DataArray::FindArray does.
- Parameters
-
- Returns
- The first matching child, or null when there is none.
◆ findArray() [2/2]
| const DataNode * Tools::Ark::DataNode::findArray |
( |
std::string_view | key | ) |
const |
|
nodiscard |
Find a child array by the symbol that opens it, the way DataArray::FindArray does.
- Parameters
-
- Returns
- The first matching child, or null when there is none.
◆ indexOf()
| int Tools::Ark::DataNode::indexOf |
( |
std::string_view | key | ) |
const |
|
nodiscard |
Find the index of a child array by the symbol that opens it.
- Parameters
-
- Returns
- The index, or -1 when there is no match.
◆ remapFiles()
template<typename Map>
| void Tools::Ark::DataNode::remapFiles |
( |
const Map & | map | ) |
|
|
inline |
Change the file index of the element and of every array below it.
- Parameters
-
| map | Callable taking an old index and returning the new one. |
◆ operator==()
| bool Tools::Ark::DataNode::operator== |
( |
const DataNode & | other | ) |
const |
|
default |
Compare two elements, their kinds, values, and arrays.
- Parameters
-
- Returns
- Whether they are equal.
◆ type
◆ value
| std::uint32_t Tools::Ark::DataNode::value = 0 |
The integer, or the bits of the float.
◆ symbol
| std::string Tools::Ark::DataNode::symbol |
◆ children
| std::vector<DataNode> Tools::Ark::DataNode::children |
The elements of an array.
◆ line
| std::uint16_t Tools::Ark::DataNode::line = 0 |
◆ sorted
| std::uint16_t Tools::Ark::DataNode::sorted = 0 |
Whether the game sorted an array before it was saved.
◆ file
| std::int32_t Tools::Ark::DataNode::file = 0 |
Index of an array's source file in the file table.
The documentation for this struct was generated from the following file: