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
YAML_PM::_Comment::_Comment
_Comment(const std::string &content_)
Definition: emittermanip.h:121
YAML_PM::Oct
@ Oct
Definition: emittermanip.h:42
YAML_PM::_Alias::_Alias
_Alias(const std::string &content_)
Definition: emittermanip.h:75
YAML_PM::_Tag::Type
Definition: emittermanip.h:93
YAML_PM::Literal
@ Literal
Definition: emittermanip.h:27
YAML_PM::_Indent::_Indent
_Indent(int value_)
Definition: emittermanip.h:66
YAML_PM::VerbatimTag
_Tag VerbatimTag(const std::string content)
Definition: emittermanip.h:104
YAML_PM::_Tag::Type::Verbatim
@ Verbatim
Definition: emittermanip.h:93
YAML_PM
Definition: aliasmanager.h:11
YAML_PM::_Anchor
Definition: emittermanip.h:83
YAML_PM::CamelCase
@ CamelCase
Definition: emittermanip.h:35
YAML_PM::_Tag::Type::PrimaryHandle
@ PrimaryHandle
Definition: emittermanip.h:93
YAML_PM::ShortBool
@ ShortBool
Definition: emittermanip.h:37
YAML_PM::LongKey
@ LongKey
Definition: emittermanip.h:62
YAML_PM::DoubleQuoted
@ DoubleQuoted
Definition: emittermanip.h:26
YAML_PM::Flow
@ Flow
Definition: emittermanip.h:51
YAML_PM::SecondaryTag
_Tag SecondaryTag(const std::string content)
Definition: emittermanip.h:116
YAML_PM::_Tag::Type::value
value
Definition: emittermanip.h:93
YAML_PM::Hex
@ Hex
Definition: emittermanip.h:41
YAML_PM::_Tag::prefix
std::string prefix
Definition: emittermanip.h:99
YAML_PM::Block
@ Block
Definition: emittermanip.h:52
testing::internal::string
::std::string string
Definition: gtest.h:1979
YAML_PM::_Precision
Definition: emittermanip.h:129
YAML_PM::TrueFalseBool
@ TrueFalseBool
Definition: emittermanip.h:31
YAML_PM::BeginMap
@ BeginMap
Definition: emittermanip.h:55
YAML_PM::_Indent
Definition: emittermanip.h:65
YAML_PM::EndSeq
@ EndSeq
Definition: emittermanip.h:50
YAML_PM::UpperCase
@ UpperCase
Definition: emittermanip.h:33
YAML_PM::SingleQuoted
@ SingleQuoted
Definition: emittermanip.h:25
YAML_PM::_Anchor::_Anchor
_Anchor(const std::string &content_)
Definition: emittermanip.h:84
YAML_PM::DoublePrecision
_Precision DoublePrecision(int n)
Definition: emittermanip.h:140
YAML_PM::OnOffBool
@ OnOffBool
Definition: emittermanip.h:32
YAML_PM::Indent
_Indent Indent(int value)
Definition: emittermanip.h:70
YAML_PM::Auto
@ Auto
Definition: emittermanip.h:15
YAML_PM::_Anchor::content
std::string content
Definition: emittermanip.h:85
YAML_PM::_Tag::_Tag
_Tag(const std::string &prefix_, const std::string &content_, Type::value type_)
Definition: emittermanip.h:95
YAML_PM::_Tag
Definition: emittermanip.h:92
YAML_PM::Precision
_Precision Precision(int n)
Definition: emittermanip.h:144
YAML_PM::Comment
_Comment Comment(const std::string content)
Definition: emittermanip.h:125
YAML_PM::Alias
_Alias Alias(const std::string content)
Definition: emittermanip.h:79
YAML_PM::_Comment::content
std::string content
Definition: emittermanip.h:122
YAML_PM::_Precision::floatPrecision
int floatPrecision
Definition: emittermanip.h:132
YAML_PM::_Precision::doublePrecision
int doublePrecision
Definition: emittermanip.h:133
YAML_PM::Dec
@ Dec
Definition: emittermanip.h:40
YAML_PM::_Indent::value
int value
Definition: emittermanip.h:67
YAML_PM::Value
@ Value
Definition: emittermanip.h:58
YAML_PM::_Precision::_Precision
_Precision(int floatPrecision_, int doublePrecision_)
Definition: emittermanip.h:130
YAML_PM::YesNoBool
@ YesNoBool
Definition: emittermanip.h:30
YAML_PM::BeginDoc
@ BeginDoc
Definition: emittermanip.h:45
YAML_PM::EmitNonAscii
@ EmitNonAscii
Definition: emittermanip.h:20
YAML_PM::EMITTER_MANIP
EMITTER_MANIP
Definition: emittermanip.h:13
YAML_PM::_Alias::content
std::string content
Definition: emittermanip.h:76
YAML_PM::FloatPrecision
_Precision FloatPrecision(int n)
Definition: emittermanip.h:136
YAML_PM::EscapeNonAscii
@ EscapeNonAscii
Definition: emittermanip.h:21
YAML_PM::Anchor
_Anchor Anchor(const std::string content)
Definition: emittermanip.h:88
YAML_PM::LongBool
@ LongBool
Definition: emittermanip.h:36
YAML_PM::_Comment
Definition: emittermanip.h:120
YAML_PM::BeginSeq
@ BeginSeq
Definition: emittermanip.h:49
YAML_PM::_Tag::Type::NamedHandle
@ NamedHandle
Definition: emittermanip.h:93
YAML_PM::_Tag::content
std::string content
Definition: emittermanip.h:100
YAML_PM::_Alias
Definition: emittermanip.h:74
YAML_PM::LowerCase
@ LowerCase
Definition: emittermanip.h:34
YAML_PM::TagByKind
@ TagByKind
Definition: emittermanip.h:16
YAML_PM::Newline
@ Newline
Definition: emittermanip.h:17
YAML_PM::EndDoc
@ EndDoc
Definition: emittermanip.h:46
YAML_PM::_Tag::type
Type::value type
Definition: emittermanip.h:101
YAML_PM::EndMap
@ EndMap
Definition: emittermanip.h:56
YAML_PM::Key
@ Key
Definition: emittermanip.h:57
YAML_PM::LocalTag
_Tag LocalTag(const std::string content)
Definition: emittermanip.h:108


mp2p_icp
Author(s):
autogenerated on Fri Dec 20 2024 03:45:57