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
14 // general manipulators
19 // output character set
23 // string manipulators
31 TrueFalseBool
, // true, false
44 // document manipulators
48 // sequence manipulators
60 // Block, // duplicate
66 _Indent(int value_
): value(value_
) {}
70 inline _Indent
Indent(int value
) {
71 return _Indent(value
);
75 _Alias(const std::string
& content_
): content(content_
) {}
79 inline _Alias
Alias(const std::string content
) {
80 return _Alias(content
);
84 _Anchor(const std::string
& content_
): content(content_
) {}
88 inline _Anchor
Anchor(const std::string content
) {
89 return _Anchor(content
);
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_
)
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
);
121 _Comment(const std::string
& content_
): content(content_
) {}
125 inline _Comment
Comment(const std::string content
) {
126 return _Comment(content
);
130 _Precision(int floatPrecision_
, int doublePrecision_
): floatPrecision(floatPrecision_
), doublePrecision(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