|
|
PixelBullet
0.0.1
A C++ game engine
|
Represents a hierarchical node capable of storing various data types and supporting YAML serialization. More...
#include <Node.hpp>
Classes | |
| struct | Format |
| Formatting options for YAML serialization. More... | |
Public Member Functions | |
| Node (const Node &)=default | |
| Node (Node &&) noexcept=default | |
| Node & | operator= (const Node &)=default |
| Node & | operator= (Node &&) noexcept=default |
| const NodeValue & | GetValue () const noexcept |
| void | SetValue (const NodeValue &value) |
| void | SetValue (NodeValue &&value) |
| NodeType | GetType () const noexcept |
| void | SetType (NodeType type) |
| void | Clear () |
| bool | IsValid () const noexcept |
| const NodeProperties & | GetProperties () const noexcept |
| NodeProperties & | GetProperties () |
| bool | HasProperty (const std::string &name) const |
| const Node * | GetProperty (const std::string &name) const |
| void | SetProperty (const std::string &name, const Node &node) |
| bool | RemoveProperty (const std::string &name) |
| Node & | operator[] (const std::string &key) |
| const Node & | operator[] (const std::string &key) const |
| Node & | operator[] (size_t index) |
| const Node & | operator[] (size_t index) const |
| template<typename T > | |
| T | As () const |
| template<typename T > | |
| void | Set (const T &in) |
| auto | begin () |
| auto | end () |
| auto | begin () const |
| auto | end () const |
| size_t | size () const noexcept |
Static Public Member Functions | |
| static bool | ParseYAML (Node &node, std::string_view str) |
| static bool | WriteYAML (const Node &node, std::ostream &stream, const Format &format=Format::Minified) |
Friends | |
| const Node & | operator>> (const Node &node, Node &out) |
| Copy the node's content. | |
| Node & | operator<< (Node &node, const Node &in) |
| Copy content from one node to another. | |
| const Node & | operator>> (const Node &node, bool &b) |
| Node & | operator<< (Node &node, bool b) |
Represents a hierarchical node capable of storing various data types and supporting YAML serialization.
The Node class stores a value as a string and maintains a list of properties for composite data types. It provides overloaded operators for convenient type conversion and YAML parsing/emission.