1 #ifndef RAPIDJSON_WRITER_H_
2 #define RAPIDJSON_WRITER_H_
13 #pragma warning(disable : 4127)
32 template<
typename Stream,
typename Encoding = UTF8<>,
typename Allocator = MemoryPoolAllocator<> >
35 typedef typename Encoding::Ch
Ch;
147 *
p++ = (u % 10) +
'0';
154 }
while (
p != buffer);
169 *
p++ =
char(u64 % 10) +
'0';
176 }
while (
p != buffer);
188 bool characterOk<char>(
Ch )
220 for (
int i = 0;
i <
ret;
i++)
232 for (
int i = 0;
i <
ret;
i++)
239 int ret = sprintf_s(buffer,
sizeof(buffer),
"%lld", d);
241 int ret = snprintf(buffer,
sizeof(buffer),
"%lld", d);
244 for (
int i = 0;
i <
ret;
i++)
251 int ret = sprintf_s(buffer,
sizeof(buffer),
"%llu", d);
253 int ret = snprintf(buffer,
sizeof(buffer),
"%llu", d);
256 for (
int i = 0;
i <
ret;
i++)
261 static const char hexDigits[] =
"0123456789ABCDEF";
262 static const char escape[256] = {
263 #define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
265 'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
'b',
't',
'n',
'u',
'f',
'r',
'u',
'u',
266 'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
'u',
267 0, 0,
'"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
269 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
'\\', 0, 0, 0,
280 if (
escape[(
unsigned char)*
p] ==
'u') {
static void escape(void *p)
Definition: BenchTimer.h:30
int i
Definition: BiCGSTAB_step_by_step.cpp:9
RowVector3d w
Definition: Matrix_resize_int.cpp:3
float * p
Definition: Tutorial_Map_using.cpp:9
Scalar * b
Definition: benchVecAdd.cpp:17
Concept for allocating, resizing and freeing memory block.
Concept for reading and writing characters.
JSON writer.
Definition: writer.h:33
Writer & Uint(unsigned u)
Definition: writer.h:61
void WriteULongLong(unsigned long long d)
Definition: writer.h:248
Writer & Double(double d)
Definition: writer.h:64
void WriteStartArray()
Definition: writer.h:295
Writer & operator=(const Writer &w)
Writer & LongDouble(long double d)
Definition: writer.h:65
Writer & String(const Ch *str, SizeType length, bool copy=false)
Definition: writer.h:69
Writer & ULongLong(unsigned long long d)
Definition: writer.h:67
Writer & Bool_(bool b)
Definition: writer.h:59
char double_format[32]
Definition: writer.h:51
void WriteString(const Ch *str, SizeType length)
Definition: writer.h:260
std::enable_if< to_int(std::numeric_limits< Ch >::max())< to_int(256), bool >::type characterOk(Ch) { return true;} template< class Ch > typename std::enable_if< to_int(std::numeric_limits< Ch >::max()) >=to_int(256), bool >::type characterOk(Ch c)
Definition: writer.h:207
static const size_t kDefaultLevelDepth
Definition: writer.h:120
static constexpr int to_int(T t)
Definition: writer.h:196
Writer & String(const Ch *str)
Simpler but slower overload.
Definition: writer.h:110
Writer(Stream &stream, int precision=20, Allocator *allocator=0, size_t levelDepth=kDefaultLevelDepth)
Definition: writer.h:37
Writer & EndObject(SizeType memberCount=0)
Definition: writer.h:83
void WriteDouble(double d)
Definition: writer.h:212
void WriteUint(unsigned u)
Definition: writer.h:143
Writer & StartArray()
Definition: writer.h:92
void WriteInt64(int64_t i64)
Definition: writer.h:157
void WriteStartObject()
Definition: writer.h:293
Writer & Uint64(uint64_t u64)
Definition: writer.h:63
Writer & Int64(int64_t i64)
Definition: writer.h:62
void WriteLongDouble(long double d)
Definition: writer.h:224
Encoding::Ch Ch
Definition: writer.h:35
void WriteBool_(bool b)
Definition: writer.h:126
Writer & StartObject()
Definition: writer.h:76
void WriteUint64(uint64_t u64)
Definition: writer.h:165
Writer & Int(int i)
Definition: writer.h:60
internal::Stack< Allocator > level_stack_
Definition: writer.h:317
Stream & stream_
Definition: writer.h:316
void WriteLongLong(long long d)
Definition: writer.h:236
void WriteNull_()
Definition: writer.h:122
void WriteEndObject()
Definition: writer.h:294
Writer & EndArray(SizeType elementCount=0)
Definition: writer.h:99
char long_double_format[32]
Definition: writer.h:52
Writer & LongLong(long long d)
Definition: writer.h:66
void Prefix(Type type)
Definition: writer.h:298
void WriteInt(int i)
Definition: writer.h:135
void WriteEndArray()
Definition: writer.h:296
Writer & Null_()
Definition: writer.h:58
A type-unsafe stack for storing different types of data.
Definition: stack.h:14
#define max(a, b)
Definition: datatypes.h:23
Eigen::DenseIndex ret
Definition: level1_cplx_impl.h:43
EIGEN_BLAS_FUNC() copy(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Definition: level1_impl.h:32
std::int64_t int64_t
Definition: Meta.h:43
std::uint64_t uint64_t
Definition: Meta.h:42
int c
Definition: calibrate.py:100
type
Definition: compute_granudrum_aor.py:141
str
Definition: compute_granudrum_aor.py:141
t
Definition: plotPSD.py:36
SizeType StrLen(const Ch *s)
Custom strlen() which works on different character types.
Definition: strfunc.h:14
Definition: document.h:13
Type
Type of JSON value.
Definition: rapidjson.h:513
@ kArrayType
array
Definition: rapidjson.h:518
@ kNull_Type
null
Definition: rapidjson.h:514
@ kTrueType
true
Definition: rapidjson.h:516
@ kFalseType
false
Definition: rapidjson.h:515
@ kNumberType
number
Definition: rapidjson.h:520
@ kObjectType
object
Definition: rapidjson.h:517
@ kStringType
string
Definition: rapidjson.h:519
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:80
Information for each nested level.
Definition: writer.h:114
Level(bool inArray_)
Definition: writer.h:115
size_t valueCount
number of values in this level
Definition: writer.h:117
bool inArray
true if in array, otherwise in object
Definition: writer.h:116