5 #include "JSONSharedString.h"
9 static json_string RemoveWhiteSpaceAndComments(
const json_string & value_t,
bool escapeQuotes) json_nothrow json_read_priority;
10 static json_char * RemoveWhiteSpaceAndCommentsC(
const json_string & value_t,
bool escapeQuotes) json_nothrow json_read_priority;
12 #ifdef JSON_READ_PRIORITY
13 static JSONNode parse(
const json_string & json) json_throws(std::invalid_argument) json_read_priority;
14 static JSONNode parse_unformatted(const json_string & json) json_throws(
std::invalid_argument) json_read_priority;
16 static JSONNode _parse_unformatted(const json_char * json, const json_char * const end) json_throws(
std::invalid_argument) json_read_priority;
18 static json_char * RemoveWhiteSpace(const json_string & value_t,
size_t & len,
bool escapeQuotes) json_nothrow json_read_priority;
20 static
void DoArray(const internalJSONNode * parent, const json_string & value_t) json_nothrow json_read_priority;
21 static
void DoNode(const internalJSONNode * parent, const json_string & value_t) json_nothrow json_read_priority;
23 #ifdef JSON_LESS_MEMORY
24 #define NAME_ENCODED this, true
25 #define STRING_ENCODED this, false
26 static json_string FixString(
const json_string & value_t,
const internalJSONNode * flag,
bool which) json_nothrow json_read_priority;
28 #define NAME_ENCODED _name_encoded
29 #define STRING_ENCODED _string_encoded
30 static json_string FixString(
const json_string & value_t,
bool & flag) json_nothrow json_read_priority;
34 #if defined(JSON_READ_PRIORITY) || defined(JSON_STREAM)
35 #if (JSON_READ_PRIORITY == HIGH) && (!(defined(JSON_LESS_MEMORY)))
36 template<json_
char ch>
37 static size_t FindNextRelevant(
const json_string & value_t,
const size_t pos) json_nothrow json_read_priority;
39 static size_t FindNextRelevant(json_char ch,
const json_string & value_t,
const size_t pos) json_nothrow json_read_priority;
42 static void UnfixString(
const json_string & value_t,
bool flag, json_string & res) json_nothrow;
44 #ifdef JSON_READ_PRIORITY
45 static json_char Hex(
const json_char * & pos) json_nothrow;
46 static json_uchar UTF8(
const json_char * & pos,
const json_char *
const end) json_nothrow;
48 #ifdef JSON_ESCAPE_WRITES
49 static json_string toUTF8(json_uchar p) json_nothrow;
52 static void UTF(
const json_char * & pos, json_string & result,
const json_char *
const end) json_nothrow;
53 #ifdef JSON_ESCAPE_WRITES
54 static json_string toSurrogatePair(json_uchar pos) json_nothrow;
57 #ifdef JSON_READ_PRIORITY
58 static void SpecialChar(
const json_char * & pos,
const json_char *
const end, json_string & res) json_nothrow;
59 static void NewNode(
const internalJSONNode * parent,
const json_string & name,
const json_string & value,
bool array) json_nothrow;