emittermanip.h
Go to the documentation of this file.
1 #ifndef EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
2 #define EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
3 
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
7 
8 
9 #include <string>
10 
11 namespace YAML_PM
12 {
14  // general manipulators
18 
19  // output character set
22 
23  // string manipulators
24  // Auto, // duplicate
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
47 
48  // sequence manipulators
53 
54  // map manipulators
57  Key,
59  // Flow, // duplicate
60  // Block, // duplicate
61  // Auto, // duplicate
63  };
64 
65  struct _Indent {
66  _Indent(int value_): value(value_) {}
67  int value;
68  };
69 
70  inline _Indent Indent(int value) {
71  return _Indent(value);
72  }
73 
74  struct _Alias {
75  _Alias(const std::string& content_): content(content_) {}
77  };
78 
79  inline _Alias Alias(const std::string content) {
80  return _Alias(content);
81  }
82 
83  struct _Anchor {
84  _Anchor(const std::string& content_): content(content_) {}
86  };
87 
88  inline _Anchor Anchor(const std::string content) {
89  return _Anchor(content);
90  }
91 
92  struct _Tag {
93  struct Type { enum value { Verbatim, PrimaryHandle, NamedHandle }; };
94 
95  explicit _Tag(const std::string& prefix_, const std::string& content_, Type::value type_)
96  : prefix(prefix_), content(content_), type(type_)
97  {
98  }
102  };
103 
104  inline _Tag VerbatimTag(const std::string content) {
105  return _Tag("", content, _Tag::Type::Verbatim);
106  }
107 
108  inline _Tag LocalTag(const std::string content) {
109  return _Tag("", content, _Tag::Type::PrimaryHandle);
110  }
111 
112  inline _Tag LocalTag(const std::string& prefix, const std::string content) {
113  return _Tag(prefix, content, _Tag::Type::NamedHandle);
114  }
115 
116  inline _Tag SecondaryTag(const std::string content) {
117  return _Tag("", content, _Tag::Type::NamedHandle);
118  }
119 
120  struct _Comment {
121  _Comment(const std::string& content_): content(content_) {}
123  };
124 
125  inline _Comment Comment(const std::string content) {
126  return _Comment(content);
127  }
128 
129  struct _Precision {
130  _Precision(int floatPrecision_, int doublePrecision_): floatPrecision(floatPrecision_), doublePrecision(doublePrecision_) {}
131 
134  };
135 
136  inline _Precision FloatPrecision(int n) {
137  return _Precision(n, -1);
138  }
139 
140  inline _Precision DoublePrecision(int n) {
141  return _Precision(-1, n);
142  }
143 
144  inline _Precision Precision(int n) {
145  return _Precision(n, n);
146  }
147 }
148 
149 #endif // EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
_Precision Precision(int n)
Definition: emittermanip.h:144
_Comment(const std::string &content_)
Definition: emittermanip.h:121
_Indent(int value_)
Definition: emittermanip.h:66
_Anchor(const std::string &content_)
Definition: emittermanip.h:84
_Precision(int floatPrecision_, int doublePrecision_)
Definition: emittermanip.h:130
::std::string string
Definition: gtest.h:1979
std::string content
Definition: emittermanip.h:76
_Comment Comment(const std::string content)
Definition: emittermanip.h:125
_Alias Alias(const std::string content)
Definition: emittermanip.h:79
_Alias(const std::string &content_)
Definition: emittermanip.h:75
_Anchor Anchor(const std::string content)
Definition: emittermanip.h:88
_Tag(const std::string &prefix_, const std::string &content_, Type::value type_)
Definition: emittermanip.h:95
std::string prefix
Definition: emittermanip.h:99
_Tag LocalTag(const std::string content)
Definition: emittermanip.h:108
std::string content
Definition: emittermanip.h:100
std::string content
Definition: emittermanip.h:122
_Indent Indent(int value)
Definition: emittermanip.h:70
_Tag VerbatimTag(const std::string content)
Definition: emittermanip.h:104
std::string content
Definition: emittermanip.h:85
Type::value type
Definition: emittermanip.h:101
_Tag SecondaryTag(const std::string content)
Definition: emittermanip.h:116
_Precision DoublePrecision(int n)
Definition: emittermanip.h:140
_Precision FloatPrecision(int n)
Definition: emittermanip.h:136


libpointmatcher
Author(s):
autogenerated on Sat May 27 2023 02:36:30