13 #ifndef __JSONV_TOKENIZER_INCLUDED__ 14 #define __JSONV_TOKENIZER_INCLUDED__ 34 array_begin = 0x00001,
50 object_begin = 0x00080,
52 object_key_delimiter = 0x00100,
60 parse_error_indicator = 0x10000,
66 return token_kind(static_cast<unsigned int>(a) | static_cast<unsigned int>(b));
72 return token_kind(static_cast<unsigned int>(a) & static_cast<unsigned int>(b));
78 return token_kind(~static_cast<unsigned int>(a));
102 using size_type = std::vector<char>::size_type;
106 static size_type min_buffer_size();
110 static void set_min_buffer_size(size_type sz);
118 operator std::pair<string_view, token_kind>()
120 return { text, kind };
148 const token& current()
const;
152 void buffer_reserve(size_type sz);
155 explicit tokenizer(std::shared_ptr<std::string> input);
159 const char* _position;
161 std::shared_ptr<void> _track;
constexpr token_kind operator~(token_kind a)
Invert flag values.
Copyright (c) 2014-2019 by Travis Gockel.
token_kind
The kind of token that was encountered in a tokenizer.
JSONV_PUBLIC const value null
An instance with kind::null.
Splits input into tokens, allowing traversal of JSON without verification.
constexpr token_kind operator|(token_kind a, token_kind b)
Combine multiple flag values.
constexpr token_kind operator&(token_kind a, token_kind b)
Filter out flag values.
JSONV_PUBLIC std::string to_string(const parse_error::problem &p)
Get a string representation of a problem.
kind
Describes the kind of data a value holds.
Pulls in an implementation of string_view.
A representation of what this tokenizer has.
#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.