1 #ifndef NODE_NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 #define NODE_NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 4 #if defined(_MSC_VER) || \ 5 (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 13 #include "yaml-cpp/dll.h" 14 #include "yaml-cpp/emitterstyle.h" 15 #include "yaml-cpp/mark.h" 16 #include "yaml-cpp/node/detail/iterator_fwd.h" 17 #include "yaml-cpp/node/ptr.h" 18 #include "yaml-cpp/node/type.h" 24 struct iterator_value;
38 template <
typename T,
typename S>
45 explicit Node(NodeType::value type);
47 explicit Node(
const T& rhs);
53 NodeType::value Type()
const;
54 bool IsDefined()
const;
55 bool IsNull()
const {
return Type() == NodeType::Null; }
56 bool IsScalar()
const {
return Type() == NodeType::Scalar; }
57 bool IsSequence()
const {
return Type() == NodeType::Sequence; }
58 bool IsMap()
const {
return Type() == NodeType::Map; }
61 explicit operator bool()
const {
return IsDefined(); }
62 bool operator!()
const {
return !IsDefined(); }
67 template <
typename T,
typename S>
68 T as(
const S& fallback)
const;
69 const std::string& Scalar()
const;
71 const std::string&
Tag()
const;
72 void SetTag(
const std::string& tag);
76 EmitterStyle::value Style()
const;
77 void SetStyle(EmitterStyle::value style);
80 bool is(
const Node& rhs)
const;
82 Node& operator=(
const T& rhs);
84 void reset(
const Node& rhs =
Node());
87 std::size_t size()
const;
97 void push_back(
const T& rhs);
98 void push_back(
const Node& rhs);
101 template <
typename Key>
102 const Node operator[](
const Key& key)
const;
103 template <
typename Key>
104 Node operator[](
const Key& key);
105 template <
typename Key>
106 bool remove(
const Key& key);
108 const Node operator[](
const Node& key)
const;
110 bool remove(
const Node& key);
113 template <
typename Key,
typename Value>
114 void force_insert(
const Key& key,
const Value& value);
117 enum Zombie { ZombieNode };
118 explicit Node(Zombie);
119 explicit Node(Zombie,
const std::string&);
122 void EnsureNodeExists()
const;
124 template <
typename T>
125 void Assign(
const T& rhs);
126 void Assign(
const char* rhs);
127 void Assign(
char* rhs);
129 void AssignData(
const Node& rhs);
130 void AssignNode(
const Node& rhs);
135 std::string m_invalidKey;
136 mutable detail::shared_memory_holder m_pMemory;
140 YAML_CPP_API
bool operator==(
const Node& lhs,
const Node& rhs);
142 YAML_CPP_API
Node Clone(
const Node& node);
144 template <
typename T>
148 #endif // NODE_NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
Definition: node_data.h:30
Definition: iterator.h:23
Definition: iterator.h:23
Definition: nodeevents.h:26
Definition: nodebuilder.h:27