15 #ifndef RAPIDJSON_PRETTYWRITER_H_ 16 #define RAPIDJSON_PRETTYWRITER_H_ 22 RAPIDJSON_DIAG_OFF(effc++)
34 template<
typename OutputStream,
typename SourceEncoding = UTF8<>,
typename TargetEncoding = UTF8<>,
typename StackAllocator = CrtAllocator>
35 class PrettyWriter :
public Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator> {
54 RAPIDJSON_ASSERT(indentChar ==
' ' || indentChar ==
'\t' || indentChar ==
'\n' || indentChar ==
'\r');
79 #if RAPIDJSON_HAS_STDSTRING 80 bool String(
const std::basic_string<Ch>& str) {
97 bool empty =
Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
121 bool empty =
Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
207 #endif // RAPIDJSON_RAPIDJSON_H_ bool String(const Ch *str, SizeType length, bool copy=false)
PrettyWriter & SetIndent(Ch indentChar, unsigned indentCharCount)
Set custom indentation.
internal::Stack< StackAllocator > level_stack_
bool String(const Ch *str)
Simpler but slower overload.
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
bool WriteInt64(int64_t i64)
Writer< OutputStream, SourceEncoding, TargetEncoding, StackAllocator > Base
GLuint GLuint GLsizei GLenum type
void PutN(FileWriteStream &stream, char c, size_t n)
Implement specialized version of PutN() with memset() for better performance.
bool EndArray(SizeType memberCount=0)
bool WriteString(const Ch *str, SizeType length)
bool Key(const Ch *str, SizeType length, bool copy=false)
void PrettyPrefix(Type type)
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
typedef void(GLAPIENTRY *PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target
static const size_t kDefaultLevelDepth
GLuint GLsizei GLsizei * length
bool EndObject(SizeType memberCount=0)
GLdouble GLdouble GLdouble b
bool Uint64(uint64_t u64)
bool WriteUint64(uint64_t u64)
size_t valueCount
number of values in this level
unsigned indentCharCount_
GLuint GLuint GLsizei count
Writer with indentation and spacing.
unsigned __int64 uint64_t
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
bool WriteUint(unsigned u)
PrettyWriter & operator=(const PrettyWriter &)
Information for each nested level.
bool WriteDouble(double d)
SizeType StrLen(const Ch *s)
Custom strlen() which works on different character types.
PrettyWriter(OutputStream &os, StackAllocator *allocator=0, size_t levelDepth=Base::kDefaultLevelDepth)
Constructor.
bool inArray
true if in array, otherwise in object
#define RAPIDJSON_ASSERT(x)
Assertion.