1 #ifndef _json_parser_hpp_ 2 #define _json_parser_hpp_ 41 std::istream &
operator>>(std::istream &stream, json &e);
60 static const size_t max_message_length = 10*1024*1024;
66 static const size_t max_token_length = 100*1024;
72 static const size_t max_nesting_depth = 1000;
83 static std::unique_ptr<json> parse(std::istream &i);
85 #ifndef _ARGO_WINDOWS_ 95 static std::unique_ptr<json> parse(
int fd);
107 static std::unique_ptr<json> parse(FILE *f);
118 static std::unique_ptr<json> parse(
const char *s);
129 static std::unique_ptr<json> parse(
const std::string &s);
140 static std::unique_ptr<json> load(
const std::string &file_name);
182 bool read_all =
true,
183 size_t p_max_token_length = max_token_length,
184 size_t p_max_nesting_depth = max_nesting_depth,
185 bool p_convert_numbers =
true,
186 bool p_fallback_to_double =
true,
187 bool p_convert_strings =
true);
194 std::unique_ptr<json> parse();
198 std::unique_ptr<json> parse_number_int(
const token &t);
199 std::unique_ptr<json> parse_number_double(
const token &t);
200 std::unique_ptr<json> parse_string(
const token &t);
201 std::unique_ptr<json> parse_value(
lexer &l,
size_t nesting_depth);
202 std::unique_ptr<json> parse_array(
lexer &l,
size_t nesting_depth);
203 void parse_name_value_pair(
lexer &l, std::unique_ptr<json> &
object,
size_t nesting_depth);
204 std::unique_ptr<json> parse_object(
lexer &l,
size_t nesting_depth);
216 size_t m_max_token_length;
219 size_t m_max_nesting_depth;
222 bool m_convert_numbers;
225 bool m_fallback_to_double;
228 bool m_convert_strings;
std::istream & operator>>(std::istream &stream, json &e)
A class to read JSON messages from various types of input stream.
#define NAMESPACE
You can change the namespace of the whole library by changing this value.
A recursive decent parser for JSON messages.
Common defs needed everywhere and, as far as is possible, platform specific changes.
Lexical tokens read from a JSON message.
A lexical analyser for JSON messages.