clang-format only the files changed on the cppref branch
Make SettingChanges move ctor default
This commit is contained in:
parent
0beba2c30f
commit
0b2309d17b
@ -22,10 +22,10 @@ class YAML_CPP_API Binary {
|
|||||||
Binary(const unsigned char *data_, std::size_t size_)
|
Binary(const unsigned char *data_, std::size_t size_)
|
||||||
: m_data{}, m_unownedData(data_), m_unownedSize(size_) {}
|
: m_data{}, m_unownedData(data_), m_unownedSize(size_) {}
|
||||||
Binary() : Binary(nullptr, 0) {}
|
Binary() : Binary(nullptr, 0) {}
|
||||||
Binary(const Binary&) = default;
|
Binary(const Binary &) = default;
|
||||||
Binary(Binary&&) = default;
|
Binary(Binary &&) = default;
|
||||||
Binary& operator=(const Binary&) = default;
|
Binary &operator=(const Binary &) = default;
|
||||||
Binary& operator=(Binary&&) = default;
|
Binary &operator=(Binary &&) = default;
|
||||||
|
|
||||||
bool owned() const { return !m_unownedData; }
|
bool owned() const { return !m_unownedData; }
|
||||||
std::size_t size() const { return owned() ? m_data.size() : m_unownedSize; }
|
std::size_t size() const { return owned() ? m_data.size() : m_unownedSize; }
|
||||||
@ -66,6 +66,6 @@ class YAML_CPP_API Binary {
|
|||||||
const unsigned char *m_unownedData;
|
const unsigned char *m_unownedData;
|
||||||
std::size_t m_unownedSize;
|
std::size_t m_unownedSize;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -35,6 +35,6 @@ class AnchorDict {
|
|||||||
private:
|
private:
|
||||||
std::vector<T> m_data;
|
std::vector<T> m_data;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -250,6 +250,6 @@ inline Emitter& operator<<(Emitter& emitter, _Indent indent) {
|
|||||||
inline Emitter& operator<<(Emitter& emitter, _Precision precision) {
|
inline Emitter& operator<<(Emitter& emitter, _Precision precision) {
|
||||||
return emitter.SetLocalPrecision(precision);
|
return emitter.SetLocalPrecision(precision);
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class YAML_CPP_API memory_holder {
|
|||||||
private:
|
private:
|
||||||
shared_memory m_pMemory;
|
shared_memory m_pMemory;
|
||||||
};
|
};
|
||||||
}
|
} // namespace detail
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -7,11 +7,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "yaml-cpp/emitterstyle.h"
|
|
||||||
#include "yaml-cpp/dll.h"
|
#include "yaml-cpp/dll.h"
|
||||||
#include "yaml-cpp/node/type.h"
|
#include "yaml-cpp/emitterstyle.h"
|
||||||
#include "yaml-cpp/node/ptr.h"
|
|
||||||
#include "yaml-cpp/node/detail/node_ref.h"
|
#include "yaml-cpp/node/detail/node_ref.h"
|
||||||
|
#include "yaml-cpp/node/ptr.h"
|
||||||
|
#include "yaml-cpp/node/type.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
@ -163,7 +163,7 @@ class node {
|
|||||||
typedef std::set<node*> nodes;
|
typedef std::set<node*> nodes;
|
||||||
nodes m_dependencies;
|
nodes m_dependencies;
|
||||||
};
|
};
|
||||||
}
|
} // namespace detail
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // NODE_DETAIL_NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // NODE_DETAIL_NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -7,11 +7,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "yaml-cpp/node/node.h"
|
#include "yaml-cpp/exceptions.h"
|
||||||
#include "yaml-cpp/node/iterator.h"
|
|
||||||
#include "yaml-cpp/node/detail/memory.h"
|
#include "yaml-cpp/node/detail/memory.h"
|
||||||
#include "yaml-cpp/node/detail/node.h"
|
#include "yaml-cpp/node/detail/node.h"
|
||||||
#include "yaml-cpp/exceptions.h"
|
#include "yaml-cpp/node/iterator.h"
|
||||||
|
#include "yaml-cpp/node/node.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
@ -366,7 +366,7 @@ template <typename T>
|
|||||||
inline typename to_value_t<T>::return_type to_value(const T& t) {
|
inline typename to_value_t<T>::return_type to_value(const T& t) {
|
||||||
return to_value_t<T>(t)();
|
return to_value_t<T>(t)();
|
||||||
}
|
}
|
||||||
}
|
} // namespace detail
|
||||||
|
|
||||||
// indexing
|
// indexing
|
||||||
template <typename Key>
|
template <typename Key>
|
||||||
@ -374,8 +374,8 @@ inline const Node Node::operator[](const Key& key) const {
|
|||||||
if (!m_isValid)
|
if (!m_isValid)
|
||||||
throw InvalidNode();
|
throw InvalidNode();
|
||||||
EnsureNodeExists();
|
EnsureNodeExists();
|
||||||
detail::node* value = static_cast<const detail::node&>(*m_pNode)
|
detail::node* value = static_cast<const detail::node&>(*m_pNode).get(
|
||||||
.get(detail::to_value(key), m_pMemory);
|
detail::to_value(key), m_pMemory);
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return Node(ZombieNode);
|
return Node(ZombieNode);
|
||||||
}
|
}
|
||||||
@ -443,6 +443,6 @@ inline void Node::force_insert(const Key& key, const Value& value) {
|
|||||||
|
|
||||||
// free functions
|
// free functions
|
||||||
inline bool operator==(const Node& lhs, const Node& rhs) { return lhs.is(rhs); }
|
inline bool operator==(const Node& lhs, const Node& rhs) { return lhs.is(rhs); }
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // NODE_IMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // NODE_IMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class YAML_CPP_API ostream_wrapper {
|
|||||||
|
|
||||||
template <std::size_t N>
|
template <std::size_t N>
|
||||||
inline ostream_wrapper& operator<<(ostream_wrapper& stream,
|
inline ostream_wrapper& operator<<(ostream_wrapper& stream,
|
||||||
const char(&str)[N]) {
|
const char (&str)[N]) {
|
||||||
stream.write(str, N - 1);
|
stream.write(str, N - 1);
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
@ -71,6 +71,6 @@ inline ostream_wrapper& operator<<(ostream_wrapper& stream, char ch) {
|
|||||||
stream.write(&ch, 1);
|
stream.write(&ch, 1);
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -86,6 +86,6 @@ class YAML_CPP_API Parser {
|
|||||||
std::unique_ptr<Scanner> m_pScanner;
|
std::unique_ptr<Scanner> m_pScanner;
|
||||||
std::unique_ptr<Directives> m_pDirectives;
|
std::unique_ptr<Directives> m_pDirectives;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stack>
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <stack>
|
||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
struct CollectionType {
|
struct CollectionType {
|
||||||
@ -36,6 +36,6 @@ class CollectionStack {
|
|||||||
private:
|
private:
|
||||||
std::stack<CollectionType::value> collectionStack;
|
std::stack<CollectionType::value> collectionStack;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -26,7 +26,11 @@ namespace YAML {
|
|||||||
class GraphBuilderAdapter : public EventHandler {
|
class GraphBuilderAdapter : public EventHandler {
|
||||||
public:
|
public:
|
||||||
GraphBuilderAdapter(GraphBuilderInterface& builder)
|
GraphBuilderAdapter(GraphBuilderInterface& builder)
|
||||||
: m_builder(builder), m_containers{}, m_anchors{}, m_pRootNode(nullptr), m_pKeyNode(nullptr) {}
|
: m_builder(builder),
|
||||||
|
m_containers{},
|
||||||
|
m_anchors{},
|
||||||
|
m_pRootNode(nullptr),
|
||||||
|
m_pKeyNode(nullptr) {}
|
||||||
GraphBuilderAdapter(const GraphBuilderAdapter&) = delete;
|
GraphBuilderAdapter(const GraphBuilderAdapter&) = delete;
|
||||||
GraphBuilderAdapter(GraphBuilderAdapter&&) = delete;
|
GraphBuilderAdapter(GraphBuilderAdapter&&) = delete;
|
||||||
GraphBuilderAdapter& operator=(const GraphBuilderAdapter&) = delete;
|
GraphBuilderAdapter& operator=(const GraphBuilderAdapter&) = delete;
|
||||||
@ -78,6 +82,6 @@ class GraphBuilderAdapter : public EventHandler {
|
|||||||
void RegisterAnchor(anchor_t anchor, void* pNode);
|
void RegisterAnchor(anchor_t anchor, void* pNode);
|
||||||
void DispositionNode(void* pNode);
|
void DispositionNode(void* pNode);
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // GRAPHBUILDERADAPTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // GRAPHBUILDERADAPTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -14,4 +14,4 @@ const std::string Directives::TranslateTagHandle(
|
|||||||
|
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -16,10 +16,11 @@ std::string ToString(YAML::anchor_t anchor) {
|
|||||||
stream << anchor;
|
stream << anchor;
|
||||||
return stream.str();
|
return stream.str();
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
EmitFromEvents::EmitFromEvents(Emitter& emitter) : m_emitter(emitter), m_stateStack{} {}
|
EmitFromEvents::EmitFromEvents(Emitter& emitter)
|
||||||
|
: m_emitter(emitter), m_stateStack{} {}
|
||||||
|
|
||||||
void EmitFromEvents::OnDocumentStart(const Mark&) {}
|
void EmitFromEvents::OnDocumentStart(const Mark&) {}
|
||||||
|
|
||||||
@ -116,4 +117,4 @@ void EmitFromEvents::EmitProps(const std::string& tag, anchor_t anchor) {
|
|||||||
if (anchor)
|
if (anchor)
|
||||||
m_emitter << Anchor(ToString(anchor));
|
m_emitter << Anchor(ToString(anchor));
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -906,4 +906,4 @@ Emitter& Emitter::Write(const Binary& binary) {
|
|||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -30,8 +30,7 @@ EmitterState::EmitterState()
|
|||||||
m_hasAnchor(false),
|
m_hasAnchor(false),
|
||||||
m_hasTag(false),
|
m_hasTag(false),
|
||||||
m_hasNonContent(false),
|
m_hasNonContent(false),
|
||||||
m_docCount(0)
|
m_docCount(0) {}
|
||||||
{}
|
|
||||||
|
|
||||||
EmitterState::~EmitterState() {}
|
EmitterState::~EmitterState() {}
|
||||||
|
|
||||||
@ -367,4 +366,4 @@ bool EmitterState::SetDoublePrecision(std::size_t value,
|
|||||||
_Set(m_doublePrecision, value, scope);
|
_Set(m_doublePrecision, value, scope);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -145,7 +145,12 @@ class EmitterState {
|
|||||||
|
|
||||||
struct Group {
|
struct Group {
|
||||||
explicit Group(GroupType::value type_)
|
explicit Group(GroupType::value type_)
|
||||||
: type(type_), flowType{}, indent(0), childCount(0), longKey(false), modifiedSettings{} {}
|
: type(type_),
|
||||||
|
flowType{},
|
||||||
|
indent(0),
|
||||||
|
childCount(0),
|
||||||
|
longKey(false),
|
||||||
|
modifiedSettings{} {}
|
||||||
|
|
||||||
GroupType::value type;
|
GroupType::value type;
|
||||||
FlowType::value flowType;
|
FlowType::value flowType;
|
||||||
@ -198,6 +203,6 @@ void EmitterState::_Set(Setting<T>& fmt, T value, FmtScope::value scope) {
|
|||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // EMITTERSTATE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // EMITTERSTATE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
#include "regeximpl.h"
|
#include "regeximpl.h"
|
||||||
#include "stringsource.h"
|
#include "stringsource.h"
|
||||||
#include "yaml-cpp/binary.h" // IWYU pragma: keep
|
#include "yaml-cpp/binary.h" // IWYU pragma: keep
|
||||||
#include "yaml-cpp/ostream_wrapper.h"
|
|
||||||
#include "yaml-cpp/null.h"
|
#include "yaml-cpp/null.h"
|
||||||
|
#include "yaml-cpp/ostream_wrapper.h"
|
||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
@ -258,7 +258,7 @@ bool WriteAliasName(ostream_wrapper& out, const std::string& str) {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
StringFormat::value ComputeStringFormat(const std::string& str,
|
StringFormat::value ComputeStringFormat(const std::string& str,
|
||||||
EMITTER_MANIP strFormat,
|
EMITTER_MANIP strFormat,
|
||||||
@ -401,8 +401,8 @@ bool WriteComment(ostream_wrapper& out, const std::string& str,
|
|||||||
for (std::string::const_iterator i = str.begin();
|
for (std::string::const_iterator i = str.begin();
|
||||||
GetNextCodePointAndAdvance(codePoint, i, str.end());) {
|
GetNextCodePointAndAdvance(codePoint, i, str.end());) {
|
||||||
if (codePoint == '\n') {
|
if (codePoint == '\n') {
|
||||||
out << "\n" << IndentTo(curIndent) << "#"
|
out << "\n"
|
||||||
<< Indentation(postCommentIndent);
|
<< IndentTo(curIndent) << "#" << Indentation(postCommentIndent);
|
||||||
out.set_comment();
|
out.set_comment();
|
||||||
} else {
|
} else {
|
||||||
WriteCodePoint(out, codePoint);
|
WriteCodePoint(out, codePoint);
|
||||||
@ -479,5 +479,5 @@ bool WriteBinary(ostream_wrapper& out, const Binary& binary) {
|
|||||||
false);
|
false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
} // namespace Utils
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -14,8 +14,8 @@ namespace YAML {
|
|||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
const std::string& node_data::empty_scalar() {
|
const std::string& node_data::empty_scalar() {
|
||||||
static const std::string svalue;
|
static const std::string svalue;
|
||||||
return svalue;
|
return svalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
node_data::node_data()
|
node_data::node_data()
|
||||||
@ -28,8 +28,7 @@ node_data::node_data()
|
|||||||
m_sequence{},
|
m_sequence{},
|
||||||
m_seqSize(0),
|
m_seqSize(0),
|
||||||
m_map{},
|
m_map{},
|
||||||
m_undefinedPairs{}
|
m_undefinedPairs{} {}
|
||||||
{}
|
|
||||||
|
|
||||||
void node_data::mark_defined() {
|
void node_data::mark_defined() {
|
||||||
if (m_type == NodeType::Undefined)
|
if (m_type == NodeType::Undefined)
|
||||||
@ -244,7 +243,8 @@ bool node_data::remove(node& key, shared_memory_holder /* pMemory */) {
|
|||||||
if (m_type != NodeType::Map)
|
if (m_type != NodeType::Map)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for(kv_pairs::iterator it = m_undefinedPairs.begin(); it != m_undefinedPairs.end();) {
|
for (kv_pairs::iterator it = m_undefinedPairs.begin();
|
||||||
|
it != m_undefinedPairs.end();) {
|
||||||
kv_pairs::iterator jt = std::next(it);
|
kv_pairs::iterator jt = std::next(it);
|
||||||
if (it->first->is(key))
|
if (it->first->is(key))
|
||||||
m_undefinedPairs.erase(it);
|
m_undefinedPairs.erase(it);
|
||||||
@ -312,5 +312,5 @@ void node_data::convert_sequence_to_map(shared_memory_holder pMemory) {
|
|||||||
reset_sequence();
|
reset_sequence();
|
||||||
m_type = NodeType::Map;
|
m_type = NodeType::Map;
|
||||||
}
|
}
|
||||||
}
|
} // namespace detail
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -16,8 +16,7 @@ NodeBuilder::NodeBuilder()
|
|||||||
m_stack{},
|
m_stack{},
|
||||||
m_anchors{},
|
m_anchors{},
|
||||||
m_keys{},
|
m_keys{},
|
||||||
m_mapDepth(0)
|
m_mapDepth(0) {
|
||||||
{
|
|
||||||
m_anchors.push_back(nullptr); // since the anchors start at 1
|
m_anchors.push_back(nullptr); // since the anchors start at 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,4 +132,4 @@ void NodeBuilder::RegisterAnchor(anchor_t anchor, detail::node& node) {
|
|||||||
m_anchors.push_back(&node);
|
m_anchors.push_back(&node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -69,6 +69,6 @@ class NodeBuilder : public EventHandler {
|
|||||||
std::vector<PushedKey> m_keys;
|
std::vector<PushedKey> m_keys;
|
||||||
std::size_t m_mapDepth;
|
std::size_t m_mapDepth;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // NODE_NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // NODE_NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -98,4 +98,4 @@ bool NodeEvents::IsAliased(const detail::node& node) const {
|
|||||||
RefCount::const_iterator it = m_refCount.find(node.ref());
|
RefCount::const_iterator it = m_refCount.find(node.ref());
|
||||||
return it != m_refCount.end() && it->second > 1;
|
return it != m_refCount.end() && it->second > 1;
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -63,6 +63,6 @@ class NodeEvents {
|
|||||||
typedef std::map<const detail::node_ref*, int> RefCount;
|
typedef std::map<const detail::node_ref*, int> RefCount;
|
||||||
RefCount m_refCount;
|
RefCount m_refCount;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // NODE_NODEEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // NODE_NODEEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -14,7 +14,12 @@ ostream_wrapper::ostream_wrapper()
|
|||||||
m_comment(false) {}
|
m_comment(false) {}
|
||||||
|
|
||||||
ostream_wrapper::ostream_wrapper(std::ostream& stream)
|
ostream_wrapper::ostream_wrapper(std::ostream& stream)
|
||||||
: m_buffer{}, m_pStream(&stream), m_pos(0), m_row(0), m_col(0), m_comment(false) {}
|
: m_buffer{},
|
||||||
|
m_pStream(&stream),
|
||||||
|
m_pos(0),
|
||||||
|
m_row(0),
|
||||||
|
m_col(0),
|
||||||
|
m_comment(false) {}
|
||||||
|
|
||||||
ostream_wrapper::~ostream_wrapper() {}
|
ostream_wrapper::~ostream_wrapper() {}
|
||||||
|
|
||||||
@ -54,4 +59,4 @@ void ostream_wrapper::update_pos(char ch) {
|
|||||||
m_comment = false;
|
m_comment = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -126,4 +126,4 @@ void Parser::PrintTokens(std::ostream& out) {
|
|||||||
m_pScanner->pop();
|
m_pScanner->pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -40,6 +40,6 @@ class ptr_vector {
|
|||||||
private:
|
private:
|
||||||
std::vector<std::unique_ptr<T>> m_data;
|
std::vector<std::unique_ptr<T>> m_data;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -10,7 +10,8 @@ RegEx::RegEx(char ch) : m_op(REGEX_MATCH), m_a(ch), m_z(0), m_params{} {}
|
|||||||
|
|
||||||
RegEx::RegEx(char a, char z) : m_op(REGEX_RANGE), m_a(a), m_z(z), m_params{} {}
|
RegEx::RegEx(char a, char z) : m_op(REGEX_RANGE), m_a(a), m_z(z), m_params{} {}
|
||||||
|
|
||||||
RegEx::RegEx(const std::string& str, REGEX_OP op) : m_op(op), m_a(0), m_z(0), m_params(str.begin(), str.end()) {}
|
RegEx::RegEx(const std::string& str, REGEX_OP op)
|
||||||
|
: m_op(op), m_a(0), m_z(0), m_params(str.begin(), str.end()) {}
|
||||||
|
|
||||||
// combination constructors
|
// combination constructors
|
||||||
RegEx operator!(const RegEx& ex) {
|
RegEx operator!(const RegEx& ex) {
|
||||||
@ -39,4 +40,4 @@ RegEx operator+(const RegEx& ex1, const RegEx& ex2) {
|
|||||||
ret.m_params.push_back(ex2);
|
ret.m_params.push_back(ex2);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -17,8 +17,7 @@ Scanner::Scanner(std::istream& in)
|
|||||||
m_simpleKeys{},
|
m_simpleKeys{},
|
||||||
m_indents{},
|
m_indents{},
|
||||||
m_indentRefs{},
|
m_indentRefs{},
|
||||||
m_flows{}
|
m_flows{} {}
|
||||||
{}
|
|
||||||
|
|
||||||
Scanner::~Scanner() {}
|
Scanner::~Scanner() {}
|
||||||
|
|
||||||
|
|||||||
@ -434,4 +434,4 @@ void Scanner::ScanBlockScalar() {
|
|||||||
token.value = scalar;
|
token.value = scalar;
|
||||||
m_tokens.push(token);
|
m_tokens.push(token);
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
class SettingChangeBase;
|
class SettingChangeBase;
|
||||||
@ -18,9 +18,7 @@ template <typename T>
|
|||||||
class Setting {
|
class Setting {
|
||||||
public:
|
public:
|
||||||
Setting() : m_value() {}
|
Setting() : m_value() {}
|
||||||
Setting(const T& value) : m_value() {
|
Setting(const T& value) : m_value() { set(value); }
|
||||||
set(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
const T get() const { return m_value; }
|
const T get() const { return m_value; }
|
||||||
std::unique_ptr<SettingChangeBase> set(const T& value);
|
std::unique_ptr<SettingChangeBase> set(const T& value);
|
||||||
@ -39,9 +37,9 @@ class SettingChangeBase {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
class SettingChange : public SettingChangeBase {
|
class SettingChange : public SettingChangeBase {
|
||||||
public:
|
public:
|
||||||
SettingChange(Setting<T>* pSetting) :
|
SettingChange(Setting<T>* pSetting)
|
||||||
m_pCurSetting(pSetting),
|
: m_pCurSetting(pSetting),
|
||||||
m_oldSetting(*pSetting) // copy old setting to save its state
|
m_oldSetting(*pSetting) // copy old setting to save its state
|
||||||
{}
|
{}
|
||||||
SettingChange(const SettingChange&) = delete;
|
SettingChange(const SettingChange&) = delete;
|
||||||
SettingChange(SettingChange&&) = delete;
|
SettingChange(SettingChange&&) = delete;
|
||||||
@ -66,7 +64,7 @@ class SettingChanges {
|
|||||||
public:
|
public:
|
||||||
SettingChanges() : m_settingChanges{} {}
|
SettingChanges() : m_settingChanges{} {}
|
||||||
SettingChanges(const SettingChanges&) = delete;
|
SettingChanges(const SettingChanges&) = delete;
|
||||||
SettingChanges(SettingChanges&& rhs) : m_settingChanges(std::move(rhs.m_settingChanges)) {}
|
SettingChanges(SettingChanges&&) = default;
|
||||||
SettingChanges& operator=(const SettingChanges&) = delete;
|
SettingChanges& operator=(const SettingChanges&) = delete;
|
||||||
~SettingChanges() { clear(); }
|
~SettingChanges() { clear(); }
|
||||||
|
|
||||||
@ -100,6 +98,6 @@ class SettingChanges {
|
|||||||
typedef std::vector<std::unique_ptr<SettingChangeBase>> setting_changes;
|
typedef std::vector<std::unique_ptr<SettingChangeBase>> setting_changes;
|
||||||
setting_changes m_settingChanges;
|
setting_changes m_settingChanges;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -19,8 +19,7 @@ SingleDocParser::SingleDocParser(Scanner& scanner, const Directives& directives)
|
|||||||
m_directives(directives),
|
m_directives(directives),
|
||||||
m_pCollectionStack(new CollectionStack),
|
m_pCollectionStack(new CollectionStack),
|
||||||
m_anchors{},
|
m_anchors{},
|
||||||
m_curAnchor(0)
|
m_curAnchor(0) {}
|
||||||
{}
|
|
||||||
|
|
||||||
SingleDocParser::~SingleDocParser() {}
|
SingleDocParser::~SingleDocParser() {}
|
||||||
|
|
||||||
@ -413,4 +412,4 @@ anchor_t SingleDocParser::LookupAnchor(const Mark& mark,
|
|||||||
|
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -63,6 +63,6 @@ class SingleDocParser {
|
|||||||
|
|
||||||
anchor_t m_curAnchor;
|
anchor_t m_curAnchor;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -111,24 +111,15 @@ static UtfIntroState s_introTransitions[][uictMax] = {
|
|||||||
|
|
||||||
static char s_introUngetCount[][uictMax] = {
|
static char s_introUngetCount[][uictMax] = {
|
||||||
// uict00, uictBB, uictBF, uictEF, uictFE, uictFF, uictAscii, uictOther
|
// uict00, uictBB, uictBF, uictEF, uictFE, uictFF, uictAscii, uictOther
|
||||||
{0, 1, 1, 0, 0, 0, 0, 1},
|
{0, 1, 1, 0, 0, 0, 0, 1}, {0, 2, 2, 2, 2, 2, 2, 2},
|
||||||
{0, 2, 2, 2, 2, 2, 2, 2},
|
{3, 3, 3, 3, 0, 3, 3, 3}, {4, 4, 4, 4, 4, 0, 4, 4},
|
||||||
{3, 3, 3, 3, 0, 3, 3, 3},
|
{1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1, 1},
|
||||||
{4, 4, 4, 4, 4, 0, 4, 4},
|
{2, 2, 2, 2, 2, 0, 2, 2}, {2, 2, 2, 2, 0, 2, 2, 2},
|
||||||
{1, 1, 1, 1, 1, 1, 1, 1},
|
{0, 1, 1, 1, 1, 1, 1, 1}, {0, 2, 2, 2, 2, 2, 2, 2},
|
||||||
{1, 1, 1, 1, 1, 1, 1, 1},
|
{1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1, 1},
|
||||||
{2, 2, 2, 2, 2, 0, 2, 2},
|
{0, 2, 2, 2, 2, 2, 2, 2}, {0, 3, 3, 3, 3, 3, 3, 3},
|
||||||
{2, 2, 2, 2, 0, 2, 2, 2},
|
{4, 4, 4, 4, 4, 4, 4, 4}, {2, 0, 2, 2, 2, 2, 2, 2},
|
||||||
{0, 1, 1, 1, 1, 1, 1, 1},
|
{3, 3, 0, 3, 3, 3, 3, 3}, {1, 1, 1, 1, 1, 1, 1, 1},
|
||||||
{0, 2, 2, 2, 2, 2, 2, 2},
|
|
||||||
{1, 1, 1, 1, 1, 1, 1, 1},
|
|
||||||
{1, 1, 1, 1, 1, 1, 1, 1},
|
|
||||||
{0, 2, 2, 2, 2, 2, 2, 2},
|
|
||||||
{0, 3, 3, 3, 3, 3, 3, 3},
|
|
||||||
{4, 4, 4, 4, 4, 4, 4, 4},
|
|
||||||
{2, 0, 2, 2, 2, 2, 2, 2},
|
|
||||||
{3, 3, 0, 3, 3, 3, 3, 3},
|
|
||||||
{1, 1, 1, 1, 1, 1, 1, 1},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline UtfIntroCharType IntroCharTypeOf(std::istream::int_type ch) {
|
inline UtfIntroCharType IntroCharTypeOf(std::istream::int_type ch) {
|
||||||
@ -197,8 +188,7 @@ Stream::Stream(std::istream& input)
|
|||||||
m_readahead{},
|
m_readahead{},
|
||||||
m_pPrefetched(new unsigned char[YAML_PREFETCH_SIZE]),
|
m_pPrefetched(new unsigned char[YAML_PREFETCH_SIZE]),
|
||||||
m_nPrefetchedAvailable(0),
|
m_nPrefetchedAvailable(0),
|
||||||
m_nPrefetchedUsed(0)
|
m_nPrefetchedUsed(0) {
|
||||||
{
|
|
||||||
typedef std::istream::traits_type char_traits;
|
typedef std::istream::traits_type char_traits;
|
||||||
|
|
||||||
if (!input)
|
if (!input)
|
||||||
@ -449,4 +439,4 @@ void Stream::StreamInUtf32() const {
|
|||||||
|
|
||||||
QueueUnicodeCodepoint(m_readahead, ch);
|
QueueUnicodeCodepoint(m_readahead, ch);
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
@ -74,6 +74,6 @@ inline bool Stream::ReadAheadTo(size_t i) const {
|
|||||||
return true;
|
return true;
|
||||||
return _ReadAheadTo(i);
|
return _ReadAheadTo(i);
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -43,6 +43,6 @@ inline const StreamCharSource StreamCharSource::operator+(int i) const {
|
|||||||
source.m_offset = 0;
|
source.m_offset = 0;
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -6,7 +6,8 @@
|
|||||||
#include "token.h"
|
#include "token.h"
|
||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
Tag::Tag(const Token& token) : type(static_cast<TYPE>(token.data)), handle{}, value{} {
|
Tag::Tag(const Token& token)
|
||||||
|
: type(static_cast<TYPE>(token.data)), handle{}, value{} {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case VERBATIM:
|
case VERBATIM:
|
||||||
value = token.value;
|
value = token.value;
|
||||||
@ -46,4 +47,4 @@ const std::string Tag::Translate(const Directives& directives) {
|
|||||||
}
|
}
|
||||||
throw std::runtime_error("yaml-cpp: internal error, bad tag type");
|
throw std::runtime_error("yaml-cpp: internal error, bad tag type");
|
||||||
}
|
}
|
||||||
}
|
} // namespace YAML
|
||||||
|
|||||||
11
src/token.h
11
src/token.h
@ -14,10 +14,11 @@
|
|||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
const std::string TokenNames[] = {
|
const std::string TokenNames[] = {
|
||||||
"DIRECTIVE", "DOC_START", "DOC_END", "BLOCK_SEQ_START", "BLOCK_MAP_START",
|
"DIRECTIVE", "DOC_START", "DOC_END", "BLOCK_SEQ_START",
|
||||||
"BLOCK_SEQ_END", "BLOCK_MAP_END", "BLOCK_ENTRY", "FLOW_SEQ_START",
|
"BLOCK_MAP_START", "BLOCK_SEQ_END", "BLOCK_MAP_END", "BLOCK_ENTRY",
|
||||||
"FLOW_MAP_START", "FLOW_SEQ_END", "FLOW_MAP_END", "FLOW_MAP_COMPACT",
|
"FLOW_SEQ_START", "FLOW_MAP_START", "FLOW_SEQ_END", "FLOW_MAP_END",
|
||||||
"FLOW_ENTRY", "KEY", "VALUE", "ANCHOR", "ALIAS", "TAG", "SCALAR"};
|
"FLOW_MAP_COMPACT", "FLOW_ENTRY", "KEY", "VALUE",
|
||||||
|
"ANCHOR", "ALIAS", "TAG", "SCALAR"};
|
||||||
|
|
||||||
struct Token {
|
struct Token {
|
||||||
// enums
|
// enums
|
||||||
@ -64,6 +65,6 @@ struct Token {
|
|||||||
std::vector<std::string> params;
|
std::vector<std::string> params;
|
||||||
int data;
|
int data;
|
||||||
};
|
};
|
||||||
}
|
} // namespace YAML
|
||||||
|
|
||||||
#endif // TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#include "gtest/gtest.h"
|
|
||||||
#include "regex_yaml.h"
|
#include "regex_yaml.h"
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
using YAML::RegEx;
|
using YAML::RegEx;
|
||||||
using YAML::Stream;
|
using YAML::Stream;
|
||||||
@ -174,4 +174,4 @@ TEST(RegExTest, StringOr) {
|
|||||||
|
|
||||||
EXPECT_EQ(1, ex.Match(str));
|
EXPECT_EQ(1, ex.Match(str));
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user