11 |
12 | #include "../anchor.h"
13 |
14 | namespace YAML {
15 | /**
16 | * An object that stores and retrieves values correlating to {@link anchor_t}
17 | * values.
18 | *
19 | * Efficient implementation that can make assumptions about how
20 | * {@code anchor_t} values are assigned by the {@link Parser} class.
21 | */
22 | template
23 | class AnchorDict {
24 | public:
25 | void Register(anchor_t anchor, T value) {
26 | if (anchor > m_data.size()) {
27 | m_data.resize(anchor);
28 | }
29 | m_data[anchor - 1] = value;
30 | }
31 |
32 | T Get(anchor_t anchor) const { return m_data[anchor - 1]; }
33 |
34 | private:
35 | std::vector m_data;
36 | };
37 | }
38 |
39 | #endif // ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66
40 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/dll.h:
--------------------------------------------------------------------------------
1 | #ifndef DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | // The following ifdef block is the standard way of creating macros which make
11 | // exporting from a DLL simpler. All files within this DLL are compiled with the
12 | // yaml_cpp_EXPORTS symbol defined on the command line. This symbol should not
13 | // be defined on any project that uses this DLL. This way any other project
14 | // whose source files include this file see YAML_CPP_API functions as being
15 | // imported from a DLL, whereas this DLL sees symbols defined with this macro as
16 | // being exported.
17 | #undef YAML_CPP_API
18 |
19 | #ifdef YAML_CPP_DLL // Using or Building YAML-CPP DLL (definition defined
20 | // manually)
21 | #ifdef yaml_cpp_EXPORTS // Building YAML-CPP DLL (definition created by CMake
22 | // or defined manually)
23 | // #pragma message( "Defining YAML_CPP_API for DLL export" )
24 | #define YAML_CPP_API __declspec(dllexport)
25 | #else // yaml_cpp_EXPORTS
26 | // #pragma message( "Defining YAML_CPP_API for DLL import" )
27 | #define YAML_CPP_API __declspec(dllimport)
28 | #endif // yaml_cpp_EXPORTS
29 | #else // YAML_CPP_DLL
30 | #define YAML_CPP_API
31 | #endif // YAML_CPP_DLL
32 |
33 | #endif // DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
34 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/emitfromevents.h:
--------------------------------------------------------------------------------
1 | #ifndef EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | #include
11 |
12 | #include "yaml-cpp/anchor.h"
13 | #include "yaml-cpp/emitterstyle.h"
14 | #include "yaml-cpp/eventhandler.h"
15 |
16 | namespace YAML {
17 | struct Mark;
18 | } // namespace YAML
19 |
20 | namespace YAML {
21 | class Emitter;
22 |
23 | class EmitFromEvents : public EventHandler {
24 | public:
25 | EmitFromEvents(Emitter& emitter);
26 |
27 | virtual void OnDocumentStart(const Mark& mark);
28 | virtual void OnDocumentEnd();
29 |
30 | virtual void OnNull(const Mark& mark, anchor_t anchor);
31 | virtual void OnAlias(const Mark& mark, anchor_t anchor);
32 | virtual void OnScalar(const Mark& mark, const std::string& tag,
33 | anchor_t anchor, const std::string& value);
34 |
35 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag,
36 | anchor_t anchor, EmitterStyle::value style);
37 | virtual void OnSequenceEnd();
38 |
39 | virtual void OnMapStart(const Mark& mark, const std::string& tag,
40 | anchor_t anchor, EmitterStyle::value style);
41 | virtual void OnMapEnd();
42 |
43 | private:
44 | void BeginNode();
45 | void EmitProps(const std::string& tag, anchor_t anchor);
46 |
47 | private:
48 | Emitter& m_emitter;
49 |
50 | struct State {
51 | enum value { WaitingForSequenceEntry, WaitingForKey, WaitingForValue };
52 | };
53 | std::stack m_stateStack;
54 | };
55 | }
56 |
57 | #endif // EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
58 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/emitterdef.h:
--------------------------------------------------------------------------------
1 | #ifndef EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | namespace YAML {
11 | struct EmitterNodeType {
12 | enum value { NoType, Property, Scalar, FlowSeq, BlockSeq, FlowMap, BlockMap };
13 | };
14 | }
15 |
16 | #endif // EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66
17 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/emittermanip.h:
--------------------------------------------------------------------------------
1 | #ifndef EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | #include
11 |
12 | namespace YAML {
13 | enum EMITTER_MANIP {
14 | // general manipulators
15 | Auto,
16 | TagByKind,
17 | Newline,
18 |
19 | // output character set
20 | EmitNonAscii,
21 | EscapeNonAscii,
22 |
23 | // string manipulators
24 | // Auto, // duplicate
25 | SingleQuoted,
26 | DoubleQuoted,
27 | Literal,
28 |
29 | // bool manipulators
30 | YesNoBool, // yes, no
31 | TrueFalseBool, // true, false
32 | OnOffBool, // on, off
33 | UpperCase, // TRUE, N
34 | LowerCase, // f, yes
35 | CamelCase, // No, Off
36 | LongBool, // yes, On
37 | ShortBool, // y, t
38 |
39 | // int manipulators
40 | Dec,
41 | Hex,
42 | Oct,
43 |
44 | // document manipulators
45 | BeginDoc,
46 | EndDoc,
47 |
48 | // sequence manipulators
49 | BeginSeq,
50 | EndSeq,
51 | Flow,
52 | Block,
53 |
54 | // map manipulators
55 | BeginMap,
56 | EndMap,
57 | Key,
58 | Value,
59 | // Flow, // duplicate
60 | // Block, // duplicate
61 | // Auto, // duplicate
62 | LongKey
63 | };
64 |
65 | struct _Indent {
66 | _Indent(int value_) : value(value_) {}
67 | int value;
68 | };
69 |
70 | inline _Indent Indent(int value) { return _Indent(value); }
71 |
72 | struct _Alias {
73 | _Alias(const std::string& content_) : content(content_) {}
74 | std::string content;
75 | };
76 |
77 | inline _Alias Alias(const std::string content) { return _Alias(content); }
78 |
79 | struct _Anchor {
80 | _Anchor(const std::string& content_) : content(content_) {}
81 | std::string content;
82 | };
83 |
84 | inline _Anchor Anchor(const std::string content) { return _Anchor(content); }
85 |
86 | struct _Tag {
87 | struct Type {
88 | enum value { Verbatim, PrimaryHandle, NamedHandle };
89 | };
90 |
91 | explicit _Tag(const std::string& prefix_, const std::string& content_,
92 | Type::value type_)
93 | : prefix(prefix_), content(content_), type(type_) {}
94 | std::string prefix;
95 | std::string content;
96 | Type::value type;
97 | };
98 |
99 | inline _Tag VerbatimTag(const std::string content) {
100 | return _Tag("", content, _Tag::Type::Verbatim);
101 | }
102 |
103 | inline _Tag LocalTag(const std::string content) {
104 | return _Tag("", content, _Tag::Type::PrimaryHandle);
105 | }
106 |
107 | inline _Tag LocalTag(const std::string& prefix, const std::string content) {
108 | return _Tag(prefix, content, _Tag::Type::NamedHandle);
109 | }
110 |
111 | inline _Tag SecondaryTag(const std::string content) {
112 | return _Tag("", content, _Tag::Type::NamedHandle);
113 | }
114 |
115 | struct _Comment {
116 | _Comment(const std::string& content_) : content(content_) {}
117 | std::string content;
118 | };
119 |
120 | inline _Comment Comment(const std::string content) { return _Comment(content); }
121 |
122 | struct _Precision {
123 | _Precision(int floatPrecision_, int doublePrecision_)
124 | : floatPrecision(floatPrecision_), doublePrecision(doublePrecision_) {}
125 |
126 | int floatPrecision;
127 | int doublePrecision;
128 | };
129 |
130 | inline _Precision FloatPrecision(int n) { return _Precision(n, -1); }
131 |
132 | inline _Precision DoublePrecision(int n) { return _Precision(-1, n); }
133 |
134 | inline _Precision Precision(int n) { return _Precision(n, n); }
135 | }
136 |
137 | #endif // EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
138 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/emitterstyle.h:
--------------------------------------------------------------------------------
1 | #ifndef EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | namespace YAML {
11 | struct EmitterStyle {
12 | enum value { Default, Block, Flow };
13 | };
14 | }
15 |
16 | #endif // EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
17 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/eventhandler.h:
--------------------------------------------------------------------------------
1 | #ifndef EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | #include
11 |
12 | #include "yaml-cpp/anchor.h"
13 | #include "yaml-cpp/emitterstyle.h"
14 |
15 | namespace YAML {
16 | struct Mark;
17 |
18 | class EventHandler {
19 | public:
20 | virtual ~EventHandler() {}
21 |
22 | virtual void OnDocumentStart(const Mark& mark) = 0;
23 | virtual void OnDocumentEnd() = 0;
24 |
25 | virtual void OnNull(const Mark& mark, anchor_t anchor) = 0;
26 | virtual void OnAlias(const Mark& mark, anchor_t anchor) = 0;
27 | virtual void OnScalar(const Mark& mark, const std::string& tag,
28 | anchor_t anchor, const std::string& value) = 0;
29 |
30 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag,
31 | anchor_t anchor, EmitterStyle::value style) = 0;
32 | virtual void OnSequenceEnd() = 0;
33 |
34 | virtual void OnMapStart(const Mark& mark, const std::string& tag,
35 | anchor_t anchor, EmitterStyle::value style) = 0;
36 | virtual void OnMapEnd() = 0;
37 | };
38 | }
39 |
40 | #endif // EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
41 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/mark.h:
--------------------------------------------------------------------------------
1 | #ifndef MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | #include "yaml-cpp/dll.h"
11 |
12 | namespace YAML {
13 | struct YAML_CPP_API Mark {
14 | Mark() : pos(0), line(0), column(0) {}
15 |
16 | static const Mark null_mark() { return Mark(-1, -1, -1); }
17 |
18 | bool is_null() const { return pos == -1 && line == -1 && column == -1; }
19 |
20 | int pos;
21 | int line, column;
22 |
23 | private:
24 | Mark(int pos_, int line_, int column_)
25 | : pos(pos_), line(line_), column(column_) {}
26 | };
27 | }
28 |
29 | #endif // MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
30 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/node/detail/bool_type.h:
--------------------------------------------------------------------------------
1 | #ifndef NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | namespace YAML {
11 | namespace detail {
12 | struct unspecified_bool {
13 | struct NOT_ALLOWED;
14 | static void true_value(NOT_ALLOWED*) {}
15 | };
16 | typedef void (*unspecified_bool_type)(unspecified_bool::NOT_ALLOWED*);
17 | }
18 | }
19 |
20 | #define YAML_CPP_OPERATOR_BOOL() \
21 | operator YAML::detail::unspecified_bool_type() const { \
22 | return this->operator!() ? 0 \
23 | : &YAML::detail::unspecified_bool::true_value; \
24 | }
25 |
26 | #endif // NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
27 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/node/detail/iterator.h:
--------------------------------------------------------------------------------
1 | #ifndef VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | #include "yaml-cpp/dll.h"
11 | #include "yaml-cpp/node/ptr.h"
12 | #include "yaml-cpp/node/detail/node_iterator.h"
13 | #include
14 | #include
15 |
16 | namespace YAML {
17 | namespace detail {
18 | struct iterator_value;
19 |
20 | template
21 | class iterator_base : public std::iterator {
23 |
24 | private:
25 | template
26 | friend class iterator_base;
27 | struct enabler {};
28 | typedef node_iterator base_type;
29 |
30 | struct proxy {
31 | explicit proxy(const V& x) : m_ref(x) {}
32 | V* operator->() { return std::addressof(m_ref); }
33 | operator V*() { return std::addressof(m_ref); }
34 |
35 | V m_ref;
36 | };
37 |
38 | public:
39 | typedef typename iterator_base::value_type value_type;
40 |
41 | public:
42 | iterator_base() : m_iterator(), m_pMemory() {}
43 | explicit iterator_base(base_type rhs, shared_memory_holder pMemory)
44 | : m_iterator(rhs), m_pMemory(pMemory) {}
45 |
46 | template
47 | iterator_base(const iterator_base& rhs,
48 | typename std::enable_if::value,
49 | enabler>::type = enabler())
50 | : m_iterator(rhs.m_iterator), m_pMemory(rhs.m_pMemory) {}
51 |
52 | iterator_base& operator++() {
53 | ++m_iterator;
54 | return *this;
55 | }
56 |
57 | iterator_base operator++(int) {
58 | iterator_base iterator_pre(*this);
59 | ++(*this);
60 | return iterator_pre;
61 | }
62 |
63 | template
64 | bool operator==(const iterator_base& rhs) const {
65 | return m_iterator == rhs.m_iterator;
66 | }
67 |
68 | template
69 | bool operator!=(const iterator_base& rhs) const {
70 | return m_iterator != rhs.m_iterator;
71 | }
72 |
73 | value_type operator*() const {
74 | const typename base_type::value_type& v = *m_iterator;
75 | if (v.pNode)
76 | return value_type(Node(*v, m_pMemory));
77 | if (v.first && v.second)
78 | return value_type(Node(*v.first, m_pMemory), Node(*v.second, m_pMemory));
79 | return value_type();
80 | }
81 |
82 | proxy operator->() const { return proxy(**this); }
83 |
84 | private:
85 | base_type m_iterator;
86 | shared_memory_holder m_pMemory;
87 | };
88 | }
89 | }
90 |
91 | #endif // VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
92 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/node/detail/iterator_fwd.h:
--------------------------------------------------------------------------------
1 | #ifndef VALUE_DETAIL_ITERATOR_FWD_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define VALUE_DETAIL_ITERATOR_FWD_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | #include "yaml-cpp/dll.h"
11 | #include
12 | #include
13 | #include
14 |
15 | namespace YAML {
16 |
17 | namespace detail {
18 | struct iterator_value;
19 | template
20 | class iterator_base;
21 | }
22 |
23 | typedef detail::iterator_base iterator;
24 | typedef detail::iterator_base const_iterator;
25 | }
26 |
27 | #endif // VALUE_DETAIL_ITERATOR_FWD_H_62B23520_7C8E_11DE_8A39_0800200C9A66
28 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/node/detail/memory.h:
--------------------------------------------------------------------------------
1 | #ifndef VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | #include
11 |
12 | #include "yaml-cpp/dll.h"
13 | #include "yaml-cpp/node/ptr.h"
14 |
15 | namespace YAML {
16 | namespace detail {
17 | class node;
18 | } // namespace detail
19 | } // namespace YAML
20 |
21 | namespace YAML {
22 | namespace detail {
23 | class YAML_CPP_API memory {
24 | public:
25 | node& create_node();
26 | void merge(const memory& rhs);
27 |
28 | private:
29 | typedef std::set Nodes;
30 | Nodes m_nodes;
31 | };
32 |
33 | class YAML_CPP_API memory_holder {
34 | public:
35 | memory_holder() : m_pMemory(new memory) {}
36 |
37 | node& create_node() { return m_pMemory->create_node(); }
38 | void merge(memory_holder& rhs);
39 |
40 | private:
41 | shared_memory m_pMemory;
42 | };
43 | }
44 | }
45 |
46 | #endif // VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66
47 |
--------------------------------------------------------------------------------
/extra/yaml-cpp/include/yaml-cpp/node/detail/node_data.h:
--------------------------------------------------------------------------------
1 | #ifndef VALUE_DETAIL_NODE_DATA_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 | #define VALUE_DETAIL_NODE_DATA_H_62B23520_7C8E_11DE_8A39_0800200C9A66
3 |
4 | #if defined(_MSC_VER) || \
5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
7 | #pragma once
8 | #endif
9 |
10 | #include
11 | #include