A node in the tree structure representing the data to export / import. More...
Public Member Functions | |
NODE_NATURE | getNodeNature () const |
NODE_VALUE_TYPE | getNodeValueType () const |
bool | isValueTypeNumber () const |
bool | hasChild (nkMemory::StringView key, NODE_VALUE_TYPE valueType) |
bool | hasChild (nkMemory::StringView key, NODE_NATURE nature) |
nkMemory::StringView | getValueAsString () const |
int | getValueAsInt () const |
unsigned int | getValueAsUint () const |
long long | getValueAsLong () const |
unsigned long long | getValueAsUlong () const |
float | getValueAsFloat () const |
double | getValueAsDouble () const |
bool | getValueAsBool () const |
unsigned int | getMemberCount () const |
nkMemory::StringView | getMemberKey (unsigned int index) const |
Node * | getMemberValue (unsigned int index) const |
Node * | getMemberValue (nkMemory::StringView key) const |
Node * | getMemberValue (nkMemory::StringView key, NODE_VALUE_TYPE valueType) const |
Node * | getMemberValue (nkMemory::StringView key, NODE_NATURE nodeNature) const |
unsigned int | getArraySize () const |
Node * | getArrayElement (unsigned int index) const |
Node * | getArrayElement (unsigned int index, NODE_VALUE_TYPE valueType) const |
Node * | getArrayElement (unsigned int index, NODE_NATURE nodeNature) const |
void * | getUserData () const |
void | setAsString (nkMemory::StringView value) |
void | setAsInt (int value) |
void | setAsUint (unsigned int value) |
void | setAsLong (long long value) |
void | setAsUlong (unsigned long long value) |
void | setAsFloat (float value) |
void | setAsDouble (double value) |
void | setAsBool (bool value) |
Node * | addMember (nkMemory::StringView key) |
void | deleteMember (nkMemory::StringView key) |
Node * | addElement () |
void | setUserData (void *value) |
Node & | operator= (const Node &) noexcept |
Node & | operator= (Node &&) noexcept |
Static Public Member Functions | |
static nkMemory::UniquePtr< Node > | create () noexcept |
static nkMemory::UniquePtr< Node > | create (const Node &other) noexcept |
static nkMemory::UniquePtr< Node > | create (Node &&other) noexcept |
A node in the tree structure representing the data to export / import.
NODE_NATURE nkExport::Node::getNodeNature | ( | ) | const |
NODE_VALUE_TYPE nkExport::Node::getNodeValueType | ( | ) | const |
bool nkExport::Node::isValueTypeNumber | ( | ) | const |
bool nkExport::Node::hasChild | ( | nkMemory::StringView | key, |
NODE_VALUE_TYPE | valueType | ||
) |
key | The key of the child to check for. |
valueType | The value type the child should have. |
bool nkExport::Node::hasChild | ( | nkMemory::StringView | key, |
NODE_NATURE | nature | ||
) |
key | The key of the child to check for. |
nature | The nature the child should have. |
nkMemory::StringView nkExport::Node::getValueAsString | ( | ) | const |
int nkExport::Node::getValueAsInt | ( | ) | const |
unsigned int nkExport::Node::getValueAsUint | ( | ) | const |
long long nkExport::Node::getValueAsLong | ( | ) | const |
unsigned long long nkExport::Node::getValueAsUlong | ( | ) | const |
float nkExport::Node::getValueAsFloat | ( | ) | const |
double nkExport::Node::getValueAsDouble | ( | ) | const |
bool nkExport::Node::getValueAsBool | ( | ) | const |
unsigned int nkExport::Node::getMemberCount | ( | ) | const |
nkMemory::StringView nkExport::Node::getMemberKey | ( | unsigned int | index | ) | const |
Allows to retrieve a key of a member, like if they were indexable. Can be used to inspect an unknown structure, for instance.
index | The index of the member key to retrieve. For instance, if a node has 5 members, it would be possible to index them from 0 to 4. |
Node* nkExport::Node::getMemberValue | ( | unsigned int | index | ) | const |
Allows to retrieve a member, like if they were indexable. See nkExport::Node::getMemberKey for more details.
index | The index of the member to retrieve. |
Node* nkExport::Node::getMemberValue | ( | nkMemory::StringView | key | ) | const |
Allows to get a member directly from its key.
key | The key identifying the wanted member. |
Node* nkExport::Node::getMemberValue | ( | nkMemory::StringView | key, |
NODE_VALUE_TYPE | valueType | ||
) | const |
Allows to get a member directly from its key, with a constraint on its value type.
key | The key identifying the wanted member. |
valueType | The value type the member should have. |
Node* nkExport::Node::getMemberValue | ( | nkMemory::StringView | key, |
NODE_NATURE | nodeNature | ||
) | const |
Allows to get a member directly from its key, with a constraint on its nature.
key | The key identifying the wanted member. |
nodeNature | The nature the member should have. |
unsigned int nkExport::Node::getArraySize | ( | ) | const |
Node* nkExport::Node::getArrayElement | ( | unsigned int | index | ) | const |
index | The index at which to index the array. |
Node* nkExport::Node::getArrayElement | ( | unsigned int | index, |
NODE_VALUE_TYPE | valueType | ||
) | const |
index | The index at which to index the array. |
valueType | The value type the element should have. |
Node* nkExport::Node::getArrayElement | ( | unsigned int | index, |
NODE_NATURE | nodeNature | ||
) | const |
index | The index at which to index the array. |
nodeNature | The nature the element should have. |
void* nkExport::Node::getUserData | ( | ) | const |
void nkExport::Node::setAsString | ( | nkMemory::StringView | value | ) |
Converts the node to hold a string.
value | The string to attach to this node. |
void nkExport::Node::setAsInt | ( | int | value | ) |
Converts the node to hold an int.
value | The int to attach to this node. |
void nkExport::Node::setAsUint | ( | unsigned int | value | ) |
Converts the node to hold an unsigned int.
value | The unsigned int to attach to this node. |
void nkExport::Node::setAsLong | ( | long long | value | ) |
Converts the node to hold a long (8 bytes).
value | The long to attach to this node. |
void nkExport::Node::setAsUlong | ( | unsigned long long | value | ) |
Converts the node to hold an unsigned long (8 bytes).
value | The unsigned long to attach to this node. |
void nkExport::Node::setAsFloat | ( | float | value | ) |
Converts the node to hold a float.
value | The float to attach to this node. |
void nkExport::Node::setAsDouble | ( | double | value | ) |
Converts the node to hold a double.
value | The double to attach to this node. |
void nkExport::Node::setAsBool | ( | bool | value | ) |
Converts the node to hold a boolean.
value | The bool to attach to this node. |
Node* nkExport::Node::addMember | ( | nkMemory::StringView | key | ) |
Converts the node as an object to hold child members.
key | The key of the member to add. |
void nkExport::Node::deleteMember | ( | nkMemory::StringView | key | ) |
Allows to erase a member from the node.
key | The key of the member to delete. |
Node* nkExport::Node::addElement | ( | ) |
Converts the node into an array to index children.
void nkExport::Node::setUserData | ( | void * | value | ) |
Allows to attach user data to the node. This data is ignored by the component, and can be used by the client application if any information needs to be communicated by this mean.
value | The data to attach to this node. |
Copy assignment operator.
Move assignment operator.
|
staticnoexcept |
Creates a node.
|
staticnoexcept |
Creates a node through a copy.
other | The node to copy. |
|
staticnoexcept |
Creates a node through a move.
other | The node to move. |