external libraries: yaml-cpp version bump
[supercollider.git] / external_libraries / yaml-cpp-0.3.0 / include / yaml-cpp / emittermanip.h
bloba8ec64a4116ecfdae35890d490eac148c333e3fb
1 #ifndef EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 #define EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
4 #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
5 #pragma once
6 #endif
9 #include <string>
11 namespace YAML
13 enum EMITTER_MANIP {
14 // general manipulators
15 Auto,
16 TagByKind,
17 Newline,
19 // output character set
20 EmitNonAscii,
21 EscapeNonAscii,
23 // string manipulators
24 // Auto, // duplicate
25 SingleQuoted,
26 DoubleQuoted,
27 Literal,
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
39 // int manipulators
40 Dec,
41 Hex,
42 Oct,
44 // document manipulators
45 BeginDoc,
46 EndDoc,
48 // sequence manipulators
49 BeginSeq,
50 EndSeq,
51 Flow,
52 Block,
54 // map manipulators
55 BeginMap,
56 EndMap,
57 Key,
58 Value,
59 // Flow, // duplicate
60 // Block, // duplicate
61 // Auto, // duplicate
62 LongKey
65 struct _Indent {
66 _Indent(int value_): value(value_) {}
67 int value;
70 inline _Indent Indent(int value) {
71 return _Indent(value);
74 struct _Alias {
75 _Alias(const std::string& content_): content(content_) {}
76 std::string content;
79 inline _Alias Alias(const std::string content) {
80 return _Alias(content);
83 struct _Anchor {
84 _Anchor(const std::string& content_): content(content_) {}
85 std::string content;
88 inline _Anchor Anchor(const std::string content) {
89 return _Anchor(content);
92 struct _Tag {
93 struct Type { enum value { Verbatim, PrimaryHandle, NamedHandle }; };
95 explicit _Tag(const std::string& prefix_, const std::string& content_, Type::value type_)
96 : prefix(prefix_), content(content_), type(type_)
99 std::string prefix;
100 std::string content;
101 Type::value type;
104 inline _Tag VerbatimTag(const std::string content) {
105 return _Tag("", content, _Tag::Type::Verbatim);
108 inline _Tag LocalTag(const std::string content) {
109 return _Tag("", content, _Tag::Type::PrimaryHandle);
112 inline _Tag LocalTag(const std::string& prefix, const std::string content) {
113 return _Tag(prefix, content, _Tag::Type::NamedHandle);
116 inline _Tag SecondaryTag(const std::string content) {
117 return _Tag("", content, _Tag::Type::NamedHandle);
120 struct _Comment {
121 _Comment(const std::string& content_): content(content_) {}
122 std::string content;
125 inline _Comment Comment(const std::string content) {
126 return _Comment(content);
129 struct _Precision {
130 _Precision(int floatPrecision_, int doublePrecision_): floatPrecision(floatPrecision_), doublePrecision(doublePrecision_) {}
132 int floatPrecision;
133 int doublePrecision;
136 inline _Precision FloatPrecision(int n) {
137 return _Precision(n, -1);
140 inline _Precision DoublePrecision(int n) {
141 return _Precision(-1, n);
144 inline _Precision Precision(int n) {
145 return _Precision(n, n);
149 #endif // EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66