Node in a VDF tree.
More...
#include <vdf.hpp>
|
| const VDFNode * | get (const std::string &key) const |
| | Find a child node by key.
|
| VDFNode * | get (const std::string &key) |
| | Find a child node by key.
|
| std::string | get_string_or (const std::string &key, std::string def) const |
| | Retrieve a string value by key with a default fallback.
|
|
int32_t | get_int_or (const std::string &key, int32_t def) const |
| | Retrieve an int32_t value by key with fallback.
|
|
uint64_t | get_uint64_or (const std::string &key, uint64_t def) const |
| | Retrieve a uint64_t value by key with fallback.
|
|
float | get_float_or (const std::string &key, float def) const |
| | Retrieve a float value by key with fallback.
|
| const VDFNode * | get_path (std::initializer_list< std::string > keys) const |
| | Find a nested node using a path of keys.
|
| Object & | as_object () |
| | Access the node as an object.
|
| const Object & | as_object () const |
| | Access the node as an object.
|
| std::string & | as_string () |
| | Access the node as a string.
|
| const std::string & | as_string () const |
| | Access the node as a string.
|
|
int32_t | as_int () const |
| | Access the node as an int32_t.
|
|
uint64_t | as_uint64 () const |
| | Access the node as a uint64_t.
|
|
float | as_float () const |
| | Access the node as a float.
|
|
|
Value | value |
| | Stored node value.
|
Node in a VDF tree.
A node contains a variant value which may represent a primitive type or a nested object. Object nodes can be queried using get or get_path.
◆ as_object() [1/2]
| Object & Steam::Utils::VDF::VDFNode::as_object |
( |
| ) |
|
|
inline |
Access the node as an object.
- Exceptions
-
| std::bad_variant_access | if the node is not an object. |
◆ as_object() [2/2]
| const Object & Steam::Utils::VDF::VDFNode::as_object |
( |
| ) |
const |
|
inline |
Access the node as an object.
- Exceptions
-
| std::bad_variant_access | if the node is not an object. |
◆ as_string() [1/2]
| std::string & Steam::Utils::VDF::VDFNode::as_string |
( |
| ) |
|
|
inline |
Access the node as a string.
- Exceptions
-
| std::bad_variant_access | if the node is not a string. |
◆ as_string() [2/2]
| const std::string & Steam::Utils::VDF::VDFNode::as_string |
( |
| ) |
const |
|
inline |
Access the node as a string.
- Exceptions
-
| std::bad_variant_access | if the node is not a string. |
◆ get() [1/2]
| VDFNode * Steam::Utils::VDF::VDFNode::get |
( |
const std::string & | key | ) |
|
|
inline |
Find a child node by key.
- Parameters
-
- Returns
- Pointer to the child node or nullptr if not found.
◆ get() [2/2]
| const VDFNode * Steam::Utils::VDF::VDFNode::get |
( |
const std::string & | key | ) |
const |
|
inline |
Find a child node by key.
- Parameters
-
- Returns
- Pointer to the child node or nullptr if not found.
◆ get_path()
| const VDFNode * Steam::Utils::VDF::VDFNode::get_path |
( |
std::initializer_list< std::string > | keys | ) |
const |
|
inline |
Find a nested node using a path of keys.
Example:
node.get_path({"appinfo","common","name"});
- Parameters
-
| keys | Sequence of nested object keys. |
- Returns
- Pointer to the final node or nullptr.
◆ get_string_or()
| std::string Steam::Utils::VDF::VDFNode::get_string_or |
( |
const std::string & | key, |
|
|
std::string | def ) const |
|
inline |
Retrieve a string value by key with a default fallback.
- Parameters
-
| key | Key to search for. |
| def | Default value returned if the key is missing or not a string. |
The documentation for this struct was generated from the following file:
- include/steamclient/utilities/vdf.hpp