|
|
@@ -106,6 +106,7 @@ class Handler {
|
|
|
bool Int64(int64_t i);
|
|
|
bool Uint64(uint64_t i);
|
|
|
bool Double(double d);
|
|
|
+ bool RawNumber(const Ch* str, SizeType length, bool copy);
|
|
|
bool String(const Ch* str, SizeType length, bool copy);
|
|
|
bool StartObject();
|
|
|
bool Key(const Ch* str, SizeType length, bool copy);
|
|
|
@@ -119,7 +120,7 @@ class Handler {
|
|
|
|
|
|
`Bool(bool)` is called when the `Reader` encounters a JSON true or false value.
|
|
|
|
|
|
-When the `Reader` encounters a JSON number, it chooses a suitable C++ type mapping. And then it calls *one* function out of `Int(int)`, `Uint(unsigned)`, `Int64(int64_t)`, `Uint64(uint64_t)` and `Double(double)`.
|
|
|
+When the `Reader` encounters a JSON number, it chooses a suitable C++ type mapping. And then it calls *one* function out of `Int(int)`, `Uint(unsigned)`, `Int64(int64_t)`, `Uint64(uint64_t)` and `Double(double)`. If `kParseNumbersAsStrings` is enabled, `Reader` will always calls `RawNumber()` instead.
|
|
|
|
|
|
`String(const char* str, SizeType length, bool copy)` is called when the `Reader` encounters a string. The first parameter is pointer to the string. The second parameter is the length of the string (excluding the null terminator). Note that RapidJSON supports null character `'\0'` inside a string. If such situation happens, `strlen(str) < length`. The last `copy` indicates whether the handler needs to make a copy of the string. For normal parsing, `copy = true`. Only when *insitu* parsing is used, `copy = false`. And beware that, the character type depends on the target encoding, which will be explained later.
|
|
|
|
|
|
@@ -419,6 +420,7 @@ struct CapitalizeFilter {
|
|
|
bool Int64(int64_t i) { return out_.Int64(i); }
|
|
|
bool Uint64(uint64_t u) { return out_.Uint64(u); }
|
|
|
bool Double(double d) { return out_.Double(d); }
|
|
|
+ bool RawNumber(const char* str, SizeType length, bool copy) { return out_.RawNumber(str, length, copy); }
|
|
|
bool String(const char* str, SizeType length, bool) {
|
|
|
buffer_.clear();
|
|
|
for (SizeType i = 0; i < length; i++)
|