1 #ifndef EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM 2 #define EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM 4 #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 30 const char *c_str()
const;
31 unsigned size()
const;
44 bool SetIndent(
unsigned n);
45 bool SetPreCommentIndent(
unsigned n);
46 bool SetPostCommentIndent(
unsigned n);
47 bool SetFloatPrecision(
unsigned n);
48 bool SetDoublePrecision(
unsigned n);
73 void PreWriteIntegralType(std::stringstream& str);
74 void PreWriteStreamable(std::stringstream& str);
75 void PostWriteIntegralType(
const std::stringstream& str);
76 void PostWriteStreamable(
const std::stringstream& str);
79 unsigned GetFloatPrecision()
const;
80 unsigned GetDoublePrecision()
const;
83 void PreAtomicWrite();
84 bool GotoNextPreAtomicState();
85 void PostAtomicWrite();
86 void EmitSeparationIfNecessary();
98 void EmitTag(
bool verbatim,
const _Tag& tag);
100 const char *ComputeFullBoolName(
bool b)
const;
101 bool CanEmitNewline()
const;
108 template <
typename T>
114 std::stringstream str;
115 PreWriteIntegralType(str);
117 PostWriteIntegralType(str);
121 template <
typename T>
127 std::stringstream str;
128 PreWriteStreamable(str);
129 SetStreamablePrecision<T>(str);
131 PostWriteStreamable(str);
136 inline void Emitter::SetStreamablePrecision<float>(std::stringstream& str)
138 str.precision(GetFloatPrecision());
142 inline void Emitter::SetStreamablePrecision<double>(std::stringstream& str)
144 str.precision(GetDoublePrecision());
186 #endif // EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
Emitter & SetLocalPrecision(const _Precision &precision)
Emitter & WriteStreamable(T value)
Emitter & SetLocalIndent(const _Indent &indent)
Emitter & Write(const std::string &str)
Emitter & operator<<(Emitter &emitter, const std::string &v)
int Write(int fd, const void *buf, unsigned int count)
void SetStreamablePrecision(std::stringstream &)
Emitter & WriteIntegralType(T value)
Emitter & SetLocalValue(EMITTER_MANIP value)
std::auto_ptr< EmitterState > m_pState