| 7747 |
ripley |
1 |
#ifndef LIBJSON_GUARD_PREPARSE_H
|
|
|
2 |
#define LIBJSON_GUARD_PREPARSE_H
|
|
|
3 |
|
|
|
4 |
#include "JSONDebug.h"
|
|
|
5 |
#include "JSONNode.h"
|
|
|
6 |
|
|
|
7 |
#if (defined(JSON_PREPARSE) && defined(JSON_READ_PRIORITY))
|
|
|
8 |
|
|
|
9 |
#ifdef JSON_COMMENTS
|
|
|
10 |
#define COMMENT_PARAM(name) ,const json_string & name
|
|
|
11 |
#else
|
|
|
12 |
#define COMMENT_PARAM(name)
|
|
|
13 |
#endif
|
|
|
14 |
|
|
|
15 |
class JSONPreparse {
|
|
|
16 |
public:
|
|
|
17 |
static JSONNode isValidNumber(json_string::const_iterator & ptr, json_string::const_iterator & end) json_read_priority;
|
|
|
18 |
static JSONNode isValidMember(json_string::const_iterator & ptr, json_string::const_iterator & end) json_read_priority;
|
|
|
19 |
static json_string isValidString(json_string::const_iterator & ptr, json_string::const_iterator & end) json_read_priority;
|
|
|
20 |
static void isValidNamedObject(json_string::const_iterator & ptr, json_string::const_iterator & end, JSONNode & parent COMMENT_PARAM(comment)) json_read_priority;
|
|
|
21 |
static JSONNode isValidObject(json_string::const_iterator & ptr, json_string::const_iterator & end) json_read_priority;
|
|
|
22 |
static JSONNode isValidArray(json_string::const_iterator & ptr, json_string::const_iterator & end) json_read_priority;
|
|
|
23 |
static JSONNode isValidRoot(const json_string & json) json_throws(std::invalid_argument) json_read_priority;
|
|
|
24 |
};
|
|
|
25 |
|
|
|
26 |
#endif
|
|
|
27 |
|
|
|
28 |
#endif
|