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;
70 const std::string& UninstrumentedScalarForTesting()
const;
72 const std::string&
Tag()
const;
73 void SetTag(
const std::string& tag);
77 EmitterStyle::value Style()
const;
78 void SetStyle(EmitterStyle::value style);
81 bool is(
const Node& rhs)
const;
83 Node& operator=(
const T& rhs);
85 void reset(
const Node& rhs =
Node());
88 std::size_t size()
const;
98 void push_back(
const T& rhs);
99 void push_back(
const Node& rhs);
102 template <
typename Key>
103 const Node operator[](
const Key& key)
const;
104 template <
typename Key>
105 Node operator[](
const Key& key);
106 template <
typename Key>
107 bool remove(
const Key& key);
109 const Node operator[](
const Node& key)
const;
111 bool remove(
const Node& key);
114 template <
typename Key,
typename Value>
115 void force_insert(
const Key& key,
const Value& value);
118 enum Zombie { ZombieNode };
119 explicit Node(Zombie);
120 explicit Node(Zombie,
const std::string&);
123 void EnsureNodeExists()
const;
126 template <
typename T>
127 void Assign(
const T& rhs);
128 void Assign(
const char* rhs);
129 void Assign(
char* rhs);
131 void AssignData(
const Node& rhs);
132 void AssignNode(
const Node& rhs);
137 std::string m_invalidKey;
138 mutable detail::shared_memory_holder m_pMemory;
142 YAML_CPP_API
bool operator==(
const Node& lhs,
const Node& rhs);
144 YAML_CPP_API
Node Clone(
const Node& node);
146 template <
typename T>
150 #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