Electroneum
Loading...
Searching...
No Matches
rapidjsontest.cpp File Reference
Include dependency graph for rapidjsontest.cpp:

Go to the source code of this file.

Classes

class  RapidJson
struct  ValueCounter
struct  NullStream

Macros

#define SIMD_SUFFIX(name)
#define TEST_TYPED(index, Name)
#define TEST_TYPED(index, Name)

Functions

 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler))
 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_ValidateEncoding))
 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler))
 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_FullPrecision))
 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParseIterative_DummyHandler))
 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParseIterativeInsitu_DummyHandler))
 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParseIterativePull_DummyHandler))
 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParseIterativePullInsitu_DummyHandler))
 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_ValidateEncoding))
 TEST_F (RapidJson, SIMD_SUFFIX(DocumentParseInsitu_MemoryPoolAllocator))
 TEST_F (RapidJson, SIMD_SUFFIX(DocumentParseIterativeInsitu_MemoryPoolAllocator))
 TEST_F (RapidJson, SIMD_SUFFIX(DocumentParse_MemoryPoolAllocator))
 TEST_F (RapidJson, SIMD_SUFFIX(DocumentParseLength_MemoryPoolAllocator))
 TEST_F (RapidJson, SIMD_SUFFIX(DocumentParseStdString_MemoryPoolAllocator))
 TEST_F (RapidJson, SIMD_SUFFIX(DocumentParseIterative_MemoryPoolAllocator))
 TEST_F (RapidJson, SIMD_SUFFIX(DocumentParse_CrtAllocator))
 TEST_F (RapidJson, SIMD_SUFFIX(DocumentParseEncodedInputStream_MemoryStream))
 TEST_F (RapidJson, SIMD_SUFFIX(DocumentParseAutoUTFInputStream_MemoryStream))
template<typename T>
size_t Traverse (const T &value)
 TEST_F (RapidJson, DocumentTraverse)
 TEST_F (RapidJson, DocumentAccept)
 TEST_F (RapidJson, Writer_NullStream)
 TEST_F (RapidJson, SIMD_SUFFIX(Writer_StringBuffer))
 TEST_F (RapidJson, SIMD_SUFFIX(PrettyWriter_StringBuffer))
 TEST_F (RapidJson, internal_Pow10)
 TEST_F (RapidJson, SkipWhitespace_Basic)
 TEST_F (RapidJson, SIMD_SUFFIX(SkipWhitespace))
 TEST_F (RapidJson, SkipWhitespace_strspn)
 TEST_F (RapidJson, UTF8_Validate)
 TEST_F (RapidJson, FileReadStream)
 TEST_F (RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_FileReadStream))
 TEST_F (RapidJson, StringBuffer)

Macro Definition Documentation

◆ SIMD_SUFFIX

#define SIMD_SUFFIX ( name)
Value:
name

Definition at line 34 of file rapidjsontest.cpp.

◆ TEST_TYPED [1/2]

#define TEST_TYPED ( index,
Name )
Value:
TEST_F(RapidJson, SIMD_SUFFIX(Writer_StringBuffer_##Name)) {\
for (size_t i = 0; i < kTrialCount * 10; i++) {\
StringBuffer s(0, 1024 * 1024);\
typesDoc_[index].Accept(writer);\
const char* str = s.GetString();\
(void)str;\
}\
}
JSON writer.
Definition writer.h:89
GenericStringBuffer< UTF8< char >, CrtAllocator > StringBuffer
Definition fwd.h:61
#define TEST_F(test_fixture, test_name)
Definition gtest.h:2216
#define SIMD_SUFFIX(name)

Definition at line 100 of file rapidjsontest.cpp.

100#define TEST_TYPED(index, Name)\
101TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_##Name)) {\
102 for (size_t i = 0; i < kTrialCount * 10; i++) {\
103 StringStream s(types_[index]);\
104 BaseReaderHandler<> h;\
105 Reader reader;\
106 EXPECT_TRUE(reader.Parse(s, h));\
107 }\
108}\
109TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_##Name)) {\
110 for (size_t i = 0; i < kTrialCount * 10; i++) {\
111 memcpy(temp_, types_[index], typesLength_[index] + 1);\
112 InsituStringStream s(temp_);\
113 BaseReaderHandler<> h;\
114 Reader reader;\
115 EXPECT_TRUE(reader.Parse<kParseInsituFlag>(s, h));\
116 }\
117}

◆ TEST_TYPED [2/2]

#define TEST_TYPED ( index,
Name )
Value:
TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_##Name)) {\
for (size_t i = 0; i < kTrialCount * 10; i++) {\
StringStream s(types_[index]);\
Reader reader;\
EXPECT_TRUE(reader.Parse(s, h));\
}\
}\
TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_##Name)) {\
for (size_t i = 0; i < kTrialCount * 10; i++) {\
memcpy(temp_, types_[index], typesLength_[index] + 1);\
InsituStringStream s(temp_);\
BaseReaderHandler<> h;\
Reader reader;\
EXPECT_TRUE(reader.Parse<kParseInsituFlag>(s, h));\
}\
}
ParseResult Parse(InputStream &is, Handler &handler)
Parse JSON text.
Definition reader.h:557
GenericStringStream< UTF8< char > > StringStream
Definition fwd.h:49
GenericInsituStringStream< UTF8< char > > InsituStringStream
Definition fwd.h:54
GenericReader< UTF8< char >, UTF8< char >, CrtAllocator > Reader
Definition fwd.h:90
@ kParseInsituFlag
In-situ(destructive) parsing.
Definition reader.h:147
Default implementation of Handler.
Definition reader.h:196

Definition at line 100 of file rapidjsontest.cpp.

100#define TEST_TYPED(index, Name)\
101TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_##Name)) {\
102 for (size_t i = 0; i < kTrialCount * 10; i++) {\
103 StringStream s(types_[index]);\
104 BaseReaderHandler<> h;\
105 Reader reader;\
106 EXPECT_TRUE(reader.Parse(s, h));\
107 }\
108}\
109TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_##Name)) {\
110 for (size_t i = 0; i < kTrialCount * 10; i++) {\
111 memcpy(temp_, types_[index], typesLength_[index] + 1);\
112 InsituStringStream s(temp_);\
113 BaseReaderHandler<> h;\
114 Reader reader;\
115 EXPECT_TRUE(reader.Parse<kParseInsituFlag>(s, h));\
116 }\
117}

Function Documentation

◆ TEST_F() [1/31]

TEST_F ( RapidJson ,
DocumentAccept  )

Definition at line 327 of file rapidjsontest.cpp.

327 {
328 for (size_t i = 0; i < kTrialCount; i++) {
329 ValueCounter counter;
330 doc_.Accept(counter);
331 EXPECT_EQ(4339u, counter.count_);
332 }
333}
#define EXPECT_EQ(val1, val2)
Definition gtest.h:1922

◆ TEST_F() [2/31]

TEST_F ( RapidJson ,
DocumentTraverse  )

Definition at line 300 of file rapidjsontest.cpp.

300 {
301 for (size_t i = 0; i < kTrialCount; i++) {
302 size_t count = Traverse(doc_);
303 EXPECT_EQ(4339u, count);
304 //if (i == 0)
305 // std::cout << count << std::endl;
306 }
307}
mdb_size_t count(MDB_cursor *cur)
size_t Traverse(const T &value)
Here is the call graph for this function:

◆ TEST_F() [3/31]

TEST_F ( RapidJson ,
FileReadStream  )

Definition at line 443 of file rapidjsontest.cpp.

443 {
444 for (size_t i = 0; i < kTrialCount; i++) {
445 FILE *fp = fopen(filename_, "rb");
446 char buffer[65536];
447 FileReadStream s(fp, buffer, sizeof(buffer));
448 while (s.Take() != '\0')
449 ;
450 fclose(fp);
451 }
452}
File byte stream for input using fread().
Here is the call graph for this function:

◆ TEST_F() [4/31]

TEST_F ( RapidJson ,
internal_Pow10  )

Definition at line 400 of file rapidjsontest.cpp.

400 {
401 double sum = 0;
402 for (size_t i = 0; i < kTrialCount * kTrialCount; i++)
403 sum += internal::Pow10(int(i & 255));
404 EXPECT_GT(sum, 0.0);
405}
#define EXPECT_GT(val1, val2)
Definition gtest.h:1934
double Pow10(int n)
Computes integer powers of 10 in double (10.0^n).
Definition pow10.h:28
Here is the call graph for this function:

◆ TEST_F() [5/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(DocumentParse_CrtAllocator)  )

Definition at line 248 of file rapidjsontest.cpp.

248 {
249 for (size_t i = 0; i < kTrialCount; i++) {
250 memcpy(temp_, json_, length_ + 1);
252 doc.Parse(temp_);
253 ASSERT_TRUE(doc.IsObject());
254 }
255}
C-runtime library allocator.
Definition allocators.h:75
A document for parsing JSON text as DOM.
Definition document.h:2130
GenericDocument & Parse(const typename SourceEncoding::Ch *str)
Parse JSON text from a read-only string (with Encoding conversion).
Definition document.h:2331
#define ASSERT_TRUE(condition)
Definition gtest.h:1865
void * memcpy(void *a, const void *b, size_t c)
Here is the call graph for this function:

◆ TEST_F() [6/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(DocumentParse_MemoryPoolAllocator)  )

Definition at line 213 of file rapidjsontest.cpp.

213 {
214 for (size_t i = 0; i < kTrialCount; i++) {
215 Document doc;
216 doc.Parse(json_);
217 ASSERT_TRUE(doc.IsObject());
218 }
219}
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
Definition document.h:2512
Here is the call graph for this function:

◆ TEST_F() [7/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(DocumentParseAutoUTFInputStream_MemoryStream)  )

Definition at line 267 of file rapidjsontest.cpp.

267 {
268 for (size_t i = 0; i < kTrialCount; i++) {
269 MemoryStream ms(json_, length_);
271 Document doc;
272 doc.ParseStream<0, AutoUTF<unsigned> >(is);
273 ASSERT_TRUE(doc.IsObject());
274 }
275}
Input stream wrapper with dynamically bound encoding and automatic encoding detection.
GenericDocument & ParseStream(InputStream &is)
Parse JSON text from an input stream (with Encoding conversion).
Definition document.h:2265
Dynamically select encoding according to stream's runtime-specified UTF encoding type.
Definition encodings.h:615
Represents an in-memory input byte stream.
Here is the call graph for this function:

◆ TEST_F() [8/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(DocumentParseEncodedInputStream_MemoryStream)  )

Definition at line 257 of file rapidjsontest.cpp.

257 {
258 for (size_t i = 0; i < kTrialCount; i++) {
259 MemoryStream ms(json_, length_);
261 Document doc;
262 doc.ParseStream<0, UTF8<> >(is);
263 ASSERT_TRUE(doc.IsObject());
264 }
265}
Input byte stream wrapper with a statically bound encoding.
UTF-8 encoding.
Definition encodings.h:96
Here is the call graph for this function:

◆ TEST_F() [9/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(DocumentParseInsitu_MemoryPoolAllocator)  )

Definition at line 195 of file rapidjsontest.cpp.

195 {
196 for (size_t i = 0; i < kTrialCount; i++) {
197 memcpy(temp_, json_, length_ + 1);
198 Document doc;
199 doc.ParseInsitu(temp_);
200 ASSERT_TRUE(doc.IsObject());
201 }
202}
GenericDocument & ParseInsitu(Ch *str)
Parse JSON text from a mutable string.
Definition document.h:2308
Here is the call graph for this function:

◆ TEST_F() [10/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(DocumentParseIterative_MemoryPoolAllocator)  )

Definition at line 240 of file rapidjsontest.cpp.

240 {
241 for (size_t i = 0; i < kTrialCount; i++) {
242 Document doc;
243 doc.Parse<kParseIterativeFlag>(json_);
244 ASSERT_TRUE(doc.IsObject());
245 }
246}
@ kParseIterativeFlag
Iterative(constant complexity in terms of function call stack size) parsing.
Definition reader.h:149
Here is the call graph for this function:

◆ TEST_F() [11/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(DocumentParseIterativeInsitu_MemoryPoolAllocator)  )

Definition at line 204 of file rapidjsontest.cpp.

204 {
205 for (size_t i = 0; i < kTrialCount; i++) {
206 memcpy(temp_, json_, length_ + 1);
207 Document doc;
209 ASSERT_TRUE(doc.IsObject());
210 }
211}
Here is the call graph for this function:

◆ TEST_F() [12/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(DocumentParseLength_MemoryPoolAllocator)  )

Definition at line 221 of file rapidjsontest.cpp.

221 {
222 for (size_t i = 0; i < kTrialCount; i++) {
223 Document doc;
224 doc.Parse(json_, length_);
225 ASSERT_TRUE(doc.IsObject());
226 }
227}
Here is the call graph for this function:

◆ TEST_F() [13/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(DocumentParseStdString_MemoryPoolAllocator)  )

Definition at line 230 of file rapidjsontest.cpp.

230 {
231 const std::string s(json_, length_);
232 for (size_t i = 0; i < kTrialCount; i++) {
233 Document doc;
234 doc.Parse(s);
235 ASSERT_TRUE(doc.IsObject());
236 }
237}
Here is the call graph for this function:

◆ TEST_F() [14/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(PrettyWriter_StringBuffer)  )

Definition at line 387 of file rapidjsontest.cpp.

387 {
388 for (size_t i = 0; i < kTrialCount; i++) {
389 StringBuffer s(0, 2048 * 1024);
391 writer.SetIndent(' ', 1);
392 doc_.Accept(writer);
393 const char* str = s.GetString();
394 (void)str;
395 //if (i == 0)
396 // std::cout << strlen(str) << std::endl;
397 }
398}
Writer with indentation and spacing.
Here is the call graph for this function:

◆ TEST_F() [15/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParse_DummyHandler)  )

Definition at line 91 of file rapidjsontest.cpp.

91 {
92 for (size_t i = 0; i < kTrialCount; i++) {
93 StringStream s(json_);
95 Reader reader;
96 EXPECT_TRUE(reader.Parse(s, h));
97 }
98}
#define EXPECT_TRUE(condition)
Definition gtest.h:1859
Here is the call graph for this function:

◆ TEST_F() [16/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParse_DummyHandler_FileReadStream)  )

Definition at line 454 of file rapidjsontest.cpp.

454 {
455 for (size_t i = 0; i < kTrialCount; i++) {
456 FILE *fp = fopen(filename_, "rb");
457 char buffer[65536];
458 FileReadStream s(fp, buffer, sizeof(buffer));
460 Reader reader;
461 reader.Parse(s, h);
462 fclose(fp);
463 }
464}
Here is the call graph for this function:

◆ TEST_F() [17/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParse_DummyHandler_FullPrecision)  )

Definition at line 129 of file rapidjsontest.cpp.

129 {
130 for (size_t i = 0; i < kTrialCount; i++) {
131 StringStream s(json_);
133 Reader reader;
135 }
136}
@ kParseFullPrecisionFlag
Parse number in full precision (but slower).
Definition reader.h:151
Here is the call graph for this function:

◆ TEST_F() [18/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParse_DummyHandler_ValidateEncoding)  )

Definition at line 186 of file rapidjsontest.cpp.

186 {
187 for (size_t i = 0; i < kTrialCount; i++) {
188 StringStream s(json_);
190 Reader reader;
192 }
193}
@ kParseValidateEncodingFlag
Validate encoding of JSON strings.
Definition reader.h:148
Here is the call graph for this function:

◆ TEST_F() [19/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParseInsitu_DummyHandler)  )

Definition at line 71 of file rapidjsontest.cpp.

71 {
72 for (size_t i = 0; i < kTrialCount; i++) {
73 memcpy(temp_, json_, length_ + 1);
74 InsituStringStream s(temp_);
76 Reader reader;
77 EXPECT_TRUE(reader.Parse<kParseInsituFlag>(s, h));
78 }
79}
Here is the call graph for this function:

◆ TEST_F() [20/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_ValidateEncoding)  )

Definition at line 81 of file rapidjsontest.cpp.

81 {
82 for (size_t i = 0; i < kTrialCount; i++) {
83 memcpy(temp_, json_, length_ + 1);
84 InsituStringStream s(temp_);
86 Reader reader;
88 }
89}
Here is the call graph for this function:

◆ TEST_F() [21/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParseIterative_DummyHandler)  )

Definition at line 138 of file rapidjsontest.cpp.

138 {
139 for (size_t i = 0; i < kTrialCount; i++) {
140 StringStream s(json_);
142 Reader reader;
144 }
145}
Here is the call graph for this function:

◆ TEST_F() [22/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParseIterativeInsitu_DummyHandler)  )

Definition at line 147 of file rapidjsontest.cpp.

147 {
148 for (size_t i = 0; i < kTrialCount; i++) {
149 memcpy(temp_, json_, length_ + 1);
150 InsituStringStream s(temp_);
152 Reader reader;
154 }
155}
Here is the call graph for this function:

◆ TEST_F() [23/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParseIterativePull_DummyHandler)  )

Definition at line 157 of file rapidjsontest.cpp.

157 {
158 for (size_t i = 0; i < kTrialCount; i++) {
159 StringStream s(json_);
161 Reader reader;
162 reader.IterativeParseInit();
163 while (!reader.IterativeParseComplete()) {
164 if (!reader.IterativeParseNext<kParseDefaultFlags>(s, h))
165 break;
166 }
167 EXPECT_FALSE(reader.HasParseError());
168 }
169}
bool IterativeParseNext(InputStream &is, Handler &handler)
Parse one token from JSON text.
Definition reader.h:618
void IterativeParseInit()
Initialize JSON text token-by-token parsing.
Definition reader.h:605
RAPIDJSON_FORCEINLINE bool IterativeParseComplete() const
Check if token-by-token parsing JSON text is complete.
Definition reader.h:675
bool HasParseError() const
Whether a parse error has occurred in the last parsing.
Definition reader.h:680
#define EXPECT_FALSE(condition)
Definition gtest.h:1862
@ kParseDefaultFlags
Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS.
Definition reader.h:156
Here is the call graph for this function:

◆ TEST_F() [24/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(ReaderParseIterativePullInsitu_DummyHandler)  )

Definition at line 171 of file rapidjsontest.cpp.

171 {
172 for (size_t i = 0; i < kTrialCount; i++) {
173 memcpy(temp_, json_, length_ + 1);
174 InsituStringStream s(temp_);
176 Reader reader;
177 reader.IterativeParseInit();
178 while (!reader.IterativeParseComplete()) {
180 break;
181 }
182 EXPECT_FALSE(reader.HasParseError());
183 }
184}
Here is the call graph for this function:

◆ TEST_F() [25/31]

Definition at line 416 of file rapidjsontest.cpp.

416 {
417 for (size_t i = 0; i < kTrialCount; i++) {
418 rapidjson::StringStream s(whitespace_);
419 rapidjson::SkipWhitespace(s);
420 ASSERT_EQ('[', s.Peek());
421 }
422}
#define ASSERT_EQ(val1, val2)
Definition gtest.h:1956
Here is the call graph for this function:

◆ TEST_F() [26/31]

TEST_F ( RapidJson ,
SIMD_SUFFIX(Writer_StringBuffer)  )

Definition at line 354 of file rapidjsontest.cpp.

354 {
355 for (size_t i = 0; i < kTrialCount; i++) {
356 StringBuffer s(0, 1024 * 1024);
357 Writer<StringBuffer> writer(s);
358 doc_.Accept(writer);
359 const char* str = s.GetString();
360 (void)str;
361 //if (i == 0)
362 // std::cout << strlen(str) << std::endl;
363 }
364}
Here is the call graph for this function:

◆ TEST_F() [27/31]

TEST_F ( RapidJson ,
SkipWhitespace_Basic  )

Definition at line 407 of file rapidjsontest.cpp.

407 {
408 for (size_t i = 0; i < kTrialCount; i++) {
409 rapidjson::StringStream s(whitespace_);
410 while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
411 s.Take();
412 ASSERT_EQ('[', s.Peek());
413 }
414}

◆ TEST_F() [28/31]

TEST_F ( RapidJson ,
SkipWhitespace_strspn  )

Definition at line 424 of file rapidjsontest.cpp.

424 {
425 for (size_t i = 0; i < kTrialCount; i++) {
426 const char* s = whitespace_ + std::strspn(whitespace_, " \t\r\n");
427 ASSERT_EQ('[', *s);
428 }
429}

◆ TEST_F() [29/31]

TEST_F ( RapidJson ,
StringBuffer  )

Definition at line 466 of file rapidjsontest.cpp.

466 {
467 StringBuffer sb;
468 for (int i = 0; i < 32 * 1024 * 1024; i++)
469 sb.Put(i & 0x7f);
470}
Here is the call graph for this function:

◆ TEST_F() [30/31]

TEST_F ( RapidJson ,
UTF8_Validate  )

Definition at line 431 of file rapidjsontest.cpp.

431 {
432 NullStream os;
433
434 for (size_t i = 0; i < kTrialCount; i++) {
435 StringStream is(json_);
436 bool result = true;
437 while (is.Peek() != '\0')
438 result &= UTF8<>::Validate(is, os);
439 EXPECT_TRUE(result);
440 }
441}
static bool Validate(InputStream &is, OutputStream &os)
Definition encodings.h:179
Here is the call graph for this function:

◆ TEST_F() [31/31]

TEST_F ( RapidJson ,
Writer_NullStream  )

Definition at line 344 of file rapidjsontest.cpp.

344 {
345 for (size_t i = 0; i < kTrialCount; i++) {
346 NullStream s;
347 Writer<NullStream> writer(s);
348 doc_.Accept(writer);
349 //if (i == 0)
350 // std::cout << s.length_ << std::endl;
351 }
352}

◆ Traverse()

template<typename T>
size_t Traverse ( const T & value)

Definition at line 278 of file rapidjsontest.cpp.

278 {
279 size_t count = 1;
280 switch(value.GetType()) {
281 case kObjectType:
282 for (typename T::ConstMemberIterator itr = value.MemberBegin(); itr != value.MemberEnd(); ++itr) {
283 count++; // name
284 count += Traverse(itr->value);
285 }
286 break;
287
288 case kArrayType:
289 for (typename T::ConstValueIterator itr = value.Begin(); itr != value.End(); ++itr)
290 count += Traverse(*itr);
291 break;
292
293 default:
294 // Do nothing.
295 break;
296 }
297 return count;
298}
const GenericPointer< typename T::ValueType > T2 value
Definition pointer.h:1225
@ kObjectType
object
Definition rapidjson.h:624
@ kArrayType
array
Definition rapidjson.h:625
Here is the call graph for this function:
Here is the caller graph for this function: