1 #ifndef EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 #define EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 4 #if defined(_MSC_VER) || \ 5 (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 73 _Indent(
int value_) : value(value_) {}
77 inline _Indent Indent(
int value) {
return _Indent(value); }
80 _Alias(
const std::string& content_) : content(content_) {}
84 inline _Alias Alias(
const std::string& content) {
return _Alias(content); }
87 _Anchor(
const std::string& content_) : content(content_) {}
91 inline _Anchor Anchor(
const std::string& content) {
return _Anchor(content); }
95 enum value { Verbatim, PrimaryHandle, NamedHandle };
98 explicit _Tag(
const std::string& prefix_,
const std::string& content_,
100 : prefix(prefix_), content(content_), type(type_) {}
106 inline _Tag VerbatimTag(
const std::string& content) {
107 return _Tag(
"", content, _Tag::Type::Verbatim);
110 inline _Tag LocalTag(
const std::string& content) {
111 return _Tag(
"", content, _Tag::Type::PrimaryHandle);
114 inline _Tag LocalTag(
const std::string& prefix,
const std::string content) {
115 return _Tag(prefix, content, _Tag::Type::NamedHandle);
118 inline _Tag SecondaryTag(
const std::string& content) {
119 return _Tag(
"", content, _Tag::Type::NamedHandle);
123 _Comment(
const std::string& content_) : content(content_) {}
127 inline _Comment Comment(
const std::string& content) {
return _Comment(content); }
130 _Precision(
int floatPrecision_,
int doublePrecision_)
131 : floatPrecision(floatPrecision_), doublePrecision(doublePrecision_) {}
137 inline _Precision FloatPrecision(
int n) {
return _Precision(n, -1); }
139 inline _Precision DoublePrecision(
int n) {
return _Precision(-1, n); }
141 inline _Precision Precision(
int n) {
return _Precision(n, n); }
144 #endif // EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66