ROSE 0.11.145.192
|
YAML node.
Definition at line 325 of file Sawyer/Yaml.h.
#include <Sawyer/Yaml.h>
Public Types | |
enum | eType { None , SequenceType , MapType , ScalarType } |
Enumeration of node types. More... | |
Public Member Functions | |
Node () | |
Default constructor. | |
Node (const Node &node) | |
Copy constructor. | |
~Node () | |
Destructor. | |
operator bool () const | |
Predicate to test whether node exists. | |
bool | operator! () const |
Predicate to test whether node exists. | |
void | clear () |
Completely clear node. | |
size_t | size () const |
Get size of node. | |
Node & | insert (const size_t index) |
Insert sequence item at given index. | |
Node & | pushFront () |
Add new sequence index to front. | |
Node & | pushBack () |
Add new sequence index to back. | |
bool | exists (const std::string &key) const |
Test whether a map item exists without inserting it. | |
eType | Type () const |
bool | IsNone () const |
bool | IsSequence () const |
bool | IsMap () const |
bool | IsScalar () const |
void | Clear () |
size_t | Size () const |
Node & | Insert (const size_t index) |
Node & | PushFront () |
Node & | PushBack () |
void | Erase (const size_t index) |
void | Erase (const std::string &key) |
Iterator | Begin () |
ConstIterator | Begin () const |
Iterator | End () |
ConstIterator | End () const |
template<typename T > | |
T | As () const |
template<typename T > | |
T | As (const T &defaultValue) const |
Node (const std::string &value) | |
Assignment constructors. | |
Node (const char *value) | |
Assignment constructors. | |
eType | type () const |
Functions for checking type of node. | |
bool | isNone () const |
Functions for checking type of node. | |
bool | isSequence () const |
Functions for checking type of node. | |
bool | isMap () const |
Functions for checking type of node. | |
bool | isScalar () const |
Functions for checking type of node. | |
template<typename T > | |
T | as () const |
Get node as given template type. | |
template<typename T > | |
T | as (const T &defaultValue) const |
Get node as given template type. | |
Node & | operator[] (const size_t index) |
Get sequence/map item. | |
Node & | operator[] (const size_t index) const |
Get sequence/map item. | |
Node & | operator[] (const std::string &key) |
Get sequence/map item. | |
Node & | operator[] (const std::string &key) const |
Get sequence/map item. | |
void | erase (const size_t index) |
Erase item. | |
void | erase (const std::string &key) |
Erase item. | |
Node & | operator= (const Node &node) |
Assignment operators. | |
Node & | operator= (const std::string &value) |
Assignment operators. | |
Node & | operator= (const char *value) |
Assignment operators. | |
template<class T > | |
Node & | operator= (const T &value) |
Assignment operators. | |
Iterator | begin () |
Get start iterator. | |
ConstIterator | begin () const |
Get start iterator. | |
Iterator | end () |
Get end iterator. | |
ConstIterator | end () const |
Get end iterator. | |
Enumeration of node types.
Definition at line 330 of file Sawyer/Yaml.h.
|
explicit |
Assignment constructors.
Converts node to scalar type if needed.
|
explicit |
Assignment constructors.
Converts node to scalar type if needed.
|
inline |
Functions for checking type of node.
Definition at line 358 of file Sawyer/Yaml.h.
|
inline |
Functions for checking type of node.
Definition at line 359 of file Sawyer/Yaml.h.
Referenced by operator bool(), and operator!().
|
inline |
Functions for checking type of node.
Definition at line 360 of file Sawyer/Yaml.h.
|
inline |
Functions for checking type of node.
Definition at line 361 of file Sawyer/Yaml.h.
|
inline |
Functions for checking type of node.
Definition at line 362 of file Sawyer/Yaml.h.
|
inlineexplicit |
Predicate to test whether node exists.
Returns true unless the node isNone.
Definition at line 368 of file Sawyer/Yaml.h.
References isNone().
|
inline |
Predicate to test whether node exists.
Returns true if node isNone.
Definition at line 375 of file Sawyer/Yaml.h.
References isNone().
|
inline |
Completely clear node.
Definition at line 380 of file Sawyer/Yaml.h.
|
inline |
Get node as given template type.
Definition at line 386 of file Sawyer/Yaml.h.
|
inline |
Get node as given template type.
Definition at line 391 of file Sawyer/Yaml.h.
|
inline |
Get size of node.
Nodes of type None or Scalar will return 0.
Definition at line 399 of file Sawyer/Yaml.h.
|
inline |
Insert sequence item at given index.
Converts node to sequence type if needed. Adding new item to end of sequence if index is larger than sequence size.
Definition at line 406 of file Sawyer/Yaml.h.
|
inline |
Add new sequence index to front.
Converts node to sequence type if needed.
Definition at line 411 of file Sawyer/Yaml.h.
|
inline |
Add new sequence index to back.
Converts node to sequence type if needed.
Definition at line 416 of file Sawyer/Yaml.h.
Node & Sawyer::Yaml::Node::operator[] | ( | const size_t | index | ) |
Node & Sawyer::Yaml::Node::operator[] | ( | const size_t | index | ) | const |
Node & Sawyer::Yaml::Node::operator[] | ( | const std::string & | key | ) |
Node & Sawyer::Yaml::Node::operator[] | ( | const std::string & | key | ) | const |
|
inline |
Test whether a map item exists without inserting it.
Definition at line 433 of file Sawyer/Yaml.h.
|
inline |
Erase item.
No action if node is not a sequence or map.
Definition at line 443 of file Sawyer/Yaml.h.
|
inline |
Erase item.
No action if node is not a sequence or map.
Definition at line 444 of file Sawyer/Yaml.h.
|
inline |
Assignment operators.
Definition at line 455 of file Sawyer/Yaml.h.
|
inline |
Get start iterator.
Definition at line 464 of file Sawyer/Yaml.h.
|
inline |
Get start iterator.
Definition at line 465 of file Sawyer/Yaml.h.
|
inline |
Get end iterator.
Definition at line 471 of file Sawyer/Yaml.h.
|
inline |
Get end iterator.
Definition at line 472 of file Sawyer/Yaml.h.
|
inline |
Definition at line 494 of file Sawyer/Yaml.h.
|
inline |
Definition at line 499 of file Sawyer/Yaml.h.