11 #ifndef __JSONV_PARSE_HPP_INCLUDED__ 12 #define __JSONV_PARSE_HPP_INCLUDED__ 32 public std::runtime_error
35 typedef std::size_t size_type;
41 problem(size_type line, size_type column, size_type character, std::string message);
77 typedef std::deque<problem> problem_list;
87 const problem_list& problems()
const;
92 const value& partial_result()
const;
95 problem_list _problems;
96 value _partial_result;
117 using size_type = value::size_type;
211 std::size_t max_failures()
const;
224 numbers number_encoding()
const;
228 commas comma_policy()
const;
235 size_type max_structure_depth()
const;
241 bool require_document()
const;
253 bool complete_parse()
const;
261 bool comments()
const;
267 on_error _failure_mode = on_error::fail_immediately;
268 std::size_t _max_failures = 10;
269 encoding _string_encoding = encoding::utf8;
270 numbers _number_encoding = numbers::decimal;
271 commas _comma_policy = commas::allow_trailing;
272 size_type _max_struct_depth = 0;
273 bool _require_document =
false;
274 bool _complete_parse =
true;
275 bool _comments =
true;
Configuration for various parsing options.
size_type line() const
The line of input this error was encountered on.
An error encountered when parsing.
const std::string & message() const
A message from the parser which has user-readable details about the encountered problem.
Copyright (c) 2014-2019 by Travis Gockel.
Description of a single parsing problem.
The existing extractor or serializer should be kept, but no exception should be thrown.
commas
When dealing with comma separators, how should extra commas be treated?
numbers
How should numbers be dealt with?
Splits input into tokens, allowing traversal of JSON without verification.
JSONV_PUBLIC std::string to_string(const parse_error::problem &p)
Get a string representation of a problem.
size_type column() const
The character index on the current line this error was encountered on.
encoding
The encoding format for strings.
Pulls in an implementation of string_view.
on_error
When a parse error is encountered, what should the parser do?
size_type character() const
The character index into the entire input this error was encountered on.
#define JSONV_PUBLIC
This function or class is part of the public API for JsonVoorhees.
JSONV_STRING_VIEW_TYPE string_view
A non-owning reference to a string.
Represents a single JSON value, which can be any one of a potential kind, each behaving slightly diff...
Copyright (c) 2012-2018 by Travis Gockel.