cphot 0.1
A C++ tool for computing photometry from spectra.
|
|
Go to the documentation of this file.
15 #ifndef RAPIDJSON_PRETTYWRITER_H_
16 #define RAPIDJSON_PRETTYWRITER_H_
22 RAPIDJSON_DIAG_OFF(effc++)
42 template<
typename OutputStream,
typename SourceEncoding = UTF8<>,
typename TargetEncoding = UTF8<>,
typename StackAllocator = CrtAllocator,
unsigned writeFlags = kWriteDefaultFlags>
43 class PrettyWriter :
public Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> {
66 RAPIDJSON_ASSERT(indentChar ==
' ' || indentChar ==
'\t' || indentChar ==
'\n' || indentChar ==
'\r');
107 #if RAPIDJSON_HAS_STDSTRING
108 bool String(
const std::basic_string<Ch>& str) {
121 #if RAPIDJSON_HAS_STDSTRING
122 bool Key(
const std::basic_string<Ch>& str) {
131 bool empty =
Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
155 bool empty =
Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
261 #endif // RAPIDJSON_RAPIDJSON_H_
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
bool WriteRawValue(const Ch *json, size_t length)
bool EndArray(SizeType memberCount=0)
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
bool WriteDouble(double d)
bool String(const Ch *str, SizeType length, bool copy=false)
PrettyWriter & SetIndent(Ch indentChar, unsigned indentCharCount)
Set custom indentation.
size_t valueCount
number of values in this level
bool WriteUint64(uint64_t u64)
bool WriteString(const Ch *str, SizeType length)
@ kFormatSingleLineArray
Format arrays on a single line.
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
bool WriteUint(unsigned u)
Writer< OutputStream, SourceEncoding, TargetEncoding, StackAllocator > Base
PrettyFormatOptions
Combination of PrettyWriter format flags.
#define RAPIDJSON_ASSERT(x)
Assertion.
Writer with indentation and spacing.
unsigned __int64 uint64_t
bool WriteInt64(int64_t i64)
PrettyWriter & SetFormatOptions(PrettyFormatOptions options)
Set pretty writer formatting options.
bool Uint64(uint64_t u64)
bool inArray
true if in array, otherwise in object
internal::Stack< StackAllocator > level_stack_
PrettyWriter(OutputStream &os, StackAllocator *allocator=0, size_t levelDepth=Base::kDefaultLevelDepth)
Constructor.
bool Key(const Ch *str, SizeType length, bool copy=false)
void PrettyPrefix(Type type)
bool String(const Ch *str)
Simpler but slower overload.
@ kFormatDefault
Default pretty formatting.
static const size_t kDefaultLevelDepth
bool EndObject(SizeType memberCount=0)
bool RawValue(const Ch *json, size_t length, Type type)
Write a raw JSON value.
unsigned indentCharCount_
Information for each nested level.
PrettyFormatOptions formatOptions_
PrettyWriter(StackAllocator *allocator=0, size_t levelDepth=Base::kDefaultLevelDepth)
bool RawNumber(const Ch *str, SizeType length, bool copy=false)
void PutN(FileWriteStream &stream, char c, size_t n)
Implement specialized version of PutN() with memset() for better performance.
SizeType StrLen(const Ch *s)
Custom strlen() which works on different character types.