Sese Framework
2.3.0
A cross-platform framework
|
JSON parser. More...
#include <Json.h>
Public Member Functions | |
Json ()=delete | |
Public Member Functions inherited from sese::NotInstantiable | |
NotInstantiable ()=delete | |
virtual | ~NotInstantiable ()=default |
NotInstantiable (const NotInstantiable &)=delete | |
NotInstantiable & | operator= (const NotInstantiable &)=delete |
Static Public Member Functions | |
static Value | parse (io::InputStream *input) |
Deserialize a JSON object from the stream. | |
static bool | streamify (io::OutputStream *out, Value &value) |
Serialize a JSON object to the stream. | |
static Value | simdParse (io::InputStream *input) |
Deserialize a JSON object from the stream using SIMD. | |
Private Types | |
using | Tokens = std::queue<std::string> |
using | ParseStack = std::stack<Value *> |
using | StreamifyStack = std::stack<std::pair<Value *, unsigned int>> |
using | StreamifyIterStack = std::stack<std::map<std::string, std::shared_ptr<Value>>::iterator> |
Static Private Member Functions | |
static Value | parse (Tokens &tokens) |
static bool | parseObject (Tokens &tokens, ParseStack &stack) |
static bool | parseArray (Tokens &tokens, ParseStack &stack) |
static Value | parseBasic (const std::string &value) |
static bool | streamifyObject (io::OutputStream *out, StreamifyStack &stack, StreamifyIterStack &map_iter_stack) |
static bool | streamifyArray (io::OutputStream *out, StreamifyStack &stack, StreamifyIterStack &map_iter_stack) |
static bool | streamifyBasic (io::OutputStream *out, const std::shared_ptr< Value > &value) |
static bool | tokenizer (io::InputStream *input_stream, Tokens &tokens) noexcept |
static Value | parse (const simdjson::dom::element &json) |
JSON parser.
|
private |
|
private |
|
private |
|
private |
|
delete |
|
staticprivate |
References sese::Value::dict(), and sese::Value::list().
|
static |
Deserialize a JSON object from the stream.
input | The input stream |
References parse(), and tokenizer().
References sese::Value::dict(), sese::Value::list(), parseArray(), and parseObject().
Referenced by parse(), and simdParse().
|
staticprivate |
References sese::Value::dict(), isKeyword(), sese::Value::list(), and parseBasic().
Referenced by parse().
|
staticprivate |
Referenced by parseArray(), and parseObject().
|
staticprivate |
References sese::Value::dict(), isKeyword(), sese::Value::list(), and parseBasic().
Referenced by parse().
|
static |
Deserialize a JSON object from the stream using SIMD.
input | The input stream |
References sese::text::AbstractStringBuffer::append(), sese::text::AbstractStringBuffer::buf(), sese::text::AbstractStringBuffer::length(), parse(), read(), and sese::io::InputStream::read().
|
static |
Serialize a JSON object to the stream.
out | The output stream |
value | The JSON object |
References sese::Value::Dict::begin(), sese::Value::getDict(), sese::Value::isDict(), streamifyArray(), and streamifyObject().
|
staticprivate |
References CONST_WRITE, count(), and streamifyBasic().
Referenced by streamify().
|
staticprivate |
References CONST_WRITE, and STRING_WRITE.
Referenced by streamifyArray(), and streamifyObject().
|
staticprivate |
References CONST_WRITE, count(), streamifyBasic(), and STRING_WRITE.
Referenced by streamify().
|
staticprivatenoexcept |
References sese::text::AbstractStringBuffer::append(), sese::text::AbstractStringBuffer::clear(), isKeyword(), sese::isSpace(), and sese::text::AbstractStringBuffer::toString().
Referenced by parse().