7#if !defined(TETENGO_JSON_JSONGRAMMAR_HPP)
8#define TETENGO_JSON_JSONGRAMMAR_HPP
13#include <unordered_map>
15#include <boost/core/noncopyable.hpp>
83 const std::unordered_map<std::string_view, std::string_view>& attributes)>;
123 std::unique_ptr<impl> m_p_impl;
bool parse(reader &reader_) const
Parses a text.
~json_grammar()
Destroys the JSON grammar.
std::function< bool( structure_type_type type, structure_open_close_type open_close, const std::unordered_map< std::string_view, std::string_view > &attributes)> structure_handler_type
The structure handler type.
Definition json_grammar.hpp:80
std::function< bool(primitive_type_type type, const std::string_view &value)> primitive_handler_type
The primitive handler type.
Definition json_grammar.hpp:52
structure_type_type
The structure type type.
Definition json_grammar.hpp:56
@ object
An object.
Definition json_grammar.hpp:57
@ member
A member.
Definition json_grammar.hpp:58
@ array
An array.
Definition json_grammar.hpp:59
primitive_type_type
The primitive type type.
Definition json_grammar.hpp:35
@ null
A null.
Definition json_grammar.hpp:39
@ boolean
A boolean.
Definition json_grammar.hpp:38
@ number
A number.
Definition json_grammar.hpp:37
@ string
A string.
Definition json_grammar.hpp:36
json_grammar(primitive_handler_type primitive_handler, structure_handler_type structure_handler)
Creates a JSON grammar.
structure_open_close_type
The structure open-close type.
Definition json_grammar.hpp:64
@ close
Closing.
Definition json_grammar.hpp:66
@ open
Opening.
Definition json_grammar.hpp:65
A reader.
Definition reader.hpp:19