simdjson 4.6.4
Ridiculously Fast JSON
Loading...
Searching...
No Matches
simdjson::SIMDJSON_IMPLEMENTATION::ondemand Namespace Reference

A fast, simple, DOM-like interface that parses JSON as you use it. More...

Classes

class  array
 A forward-only JSON array. More...
 
class  array_iterator
 A forward-only JSON array. More...
 
class  document
 A JSON document. More...
 
class  document_reference
 A document_reference is a thin wrapper around a document reference instance. More...
 
class  document_stream
 A forward-only stream of documents. More...
 
class  field
 A JSON field (key/value pair) in an object. More...
 
struct  number
 A type representing a JSON number. More...
 
class  object
 A forward-only JSON object field iterator. More...
 
class  object_iterator
 
class  parser
 A JSON fragment iterator. More...
 
class  raw_json_string
 A string escaped per JSON rules, terminated with quote ("). More...
 
class  value
 An ephemeral JSON value returned during iteration. More...
 

Typedefs

using depth_t = int32_t
 Represents the depth of a JSON value (number of nested arrays/objects).
 
using number_type = simdjson::SIMDJSON_IMPLEMENTATION::number_type
 The type of a JSON number.
 

Enumerations

enum class  json_type {
  unknown =0 , array =1 , object , number ,
  string , boolean , null
}
 The type of a JSON value. More...
 

Functions

std::ostream & operator<< (std::ostream &out, json_type type) noexcept
 Write the JSON type to the output stream.
 
std::ostream & operator<< (std::ostream &out, simdjson_result< json_type > &type) noexcept(false)
 Send JSON type to an output stream.
 
simdjson_unused simdjson_inline bool operator== (const raw_json_string &a, std::string_view c) noexcept
 Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user is responsible for providing a string with no unescaped quote.
 
simdjson_unused simdjson_inline bool operator== (std::string_view c, const raw_json_string &a) noexcept
 
simdjson_unused simdjson_inline bool operator!= (const raw_json_string &a, std::string_view c) noexcept
 
simdjson_unused simdjson_inline bool operator!= (std::string_view c, const raw_json_string &a) noexcept
 
simdjson_unused simdjson_inline std::ostream & operator<< (std::ostream &out, const raw_json_string &str) noexcept
 
std::ostream & operator<< (std::ostream &out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value x)
 Print JSON to an output stream.
 
std::ostream & operator<< (std::ostream &out, simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value > x)
 
std::ostream & operator<< (std::ostream &out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array value)
 Print JSON to an output stream.
 
std::ostream & operator<< (std::ostream &out, simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array > x)
 
std::ostream & operator<< (std::ostream &out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document &value)
 Print JSON to an output stream.
 
std::ostream & operator<< (std::ostream &out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document_reference &value)
 
std::ostream & operator<< (std::ostream &out, simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document > &&x)
 
std::ostream & operator<< (std::ostream &out, simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document_reference > &&x)
 
std::ostream & operator<< (std::ostream &out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::object value)
 Print JSON to an output stream.
 
std::ostream & operator<< (std::ostream &out, simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::object > x)
 
bool is_pointer_well_formed (std::string_view json_pointer) noexcept
 

Detailed Description

A fast, simple, DOM-like interface that parses JSON as you use it.

Designed for maximum speed and a lower memory profile.

Typedef Documentation

◆ depth_t

Represents the depth of a JSON value (number of nested arrays/objects).

Definition at line 18 of file base.h.

◆ number_type

using simdjson::SIMDJSON_IMPLEMENTATION::ondemand::number_type = typedef simdjson::SIMDJSON_IMPLEMENTATION::number_type

The type of a JSON number.

Definition at line 21 of file base.h.

Enumeration Type Documentation

◆ json_type

The type of a JSON value.

Enumerator
array 

A JSON array ( [ 1, 2, 3 ... ] )

object 

A JSON object ( { "a": 1, "b" 2, ... } )

number 

A JSON number ( 1 or -2.3 or 4.5e6 ...)

string 

A JSON string ( "a" or "hello world\n" ...)

boolean 

A JSON boolean (true or false)

null 

A JSON null (null)

Definition at line 17 of file json_type.h.

Function Documentation

◆ is_pointer_well_formed()

bool simdjson::SIMDJSON_IMPLEMENTATION::ondemand::is_pointer_well_formed ( std::string_view  json_pointer)
inlinenoexcept

Definition at line 266 of file value-inl.h.

◆ operator!=() [1/2]

simdjson_unused simdjson_inline bool simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator!= ( const raw_json_string a,
std::string_view  c 
)
noexcept

Definition at line 155 of file raw_json_string-inl.h.

◆ operator!=() [2/2]

simdjson_unused simdjson_inline bool simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator!= ( std::string_view  c,
const raw_json_string a 
)
noexcept

Definition at line 159 of file raw_json_string-inl.h.

◆ operator<<() [1/13]

simdjson_unused simdjson_inline std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
const raw_json_string str 
)
noexcept

Definition at line 172 of file raw_json_string-inl.h.

◆ operator<<() [2/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
json_type  type 
)
inlinenoexcept

Write the JSON type to the output stream.

Parameters
outThe output stream.
typeThe json_type.

Definition at line 14 of file json_type-inl.h.

◆ operator<<() [3/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array  value 
)
inline

Print JSON to an output stream.

It does not validate the content.

Parameters
outThe output stream.
valueThe array.
Exceptions
ifthere is an error with the underlying output stream. simdjson itself will not throw.

Definition at line 145 of file serialization-inl.h.

◆ operator<<() [4/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document value 
)
inline

Print JSON to an output stream.

It does not validate the content.

Parameters
outThe output stream.
valueThe array.
Exceptions
ifthere is an error with the underlying output stream. simdjson itself will not throw.

Definition at line 171 of file serialization-inl.h.

◆ operator<<() [5/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document_reference value 
)
inline

Definition at line 180 of file serialization-inl.h.

◆ operator<<() [6/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::SIMDJSON_IMPLEMENTATION::ondemand::object  value 
)
inline

Print JSON to an output stream.

It does not validate the content.

Parameters
outThe output stream.
valueThe object.
Exceptions
ifthere is an error with the underlying output stream. simdjson itself will not throw.

Definition at line 210 of file serialization-inl.h.

◆ operator<<() [7/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value  x 
)
inline

Print JSON to an output stream.

It does not validate the content.

Parameters
outThe output stream.
valueThe element.
Exceptions
ifthere is an error with the underlying output stream. simdjson itself will not throw.

Definition at line 119 of file serialization-inl.h.

◆ operator<<() [8/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array x 
)
inline

Definition at line 154 of file serialization-inl.h.

◆ operator<<() [9/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document > &&  x 
)
inline

Definition at line 189 of file serialization-inl.h.

◆ operator<<() [10/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document_reference > &&  x 
)
inline

Definition at line 193 of file serialization-inl.h.

◆ operator<<() [11/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::object x 
)
inline

Definition at line 219 of file serialization-inl.h.

◆ operator<<() [12/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson::simdjson_result< simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value x 
)
inline

Definition at line 128 of file serialization-inl.h.

◆ operator<<() [13/13]

std::ostream & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator<< ( std::ostream &  out,
simdjson_result< json_type > &  type 
)
inline

Send JSON type to an output stream.

Parameters
outThe output stream.
typeThe json_type.
Exceptions
simdjson_errorif the result being printed has an error. If there is an error with the underlying output stream, that error will be propagated (simdjson_error will not be thrown).

Definition at line 28 of file json_type-inl.h.

◆ operator==() [1/2]

simdjson_unused simdjson_inline bool simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator== ( const raw_json_string a,
std::string_view  c 
)
noexcept

Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user is responsible for providing a string with no unescaped quote.

Note that unescaped quotes cannot be present in valid JSON strings.

Definition at line 147 of file raw_json_string-inl.h.

◆ operator==() [2/2]

simdjson_unused simdjson_inline bool simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator== ( std::string_view  c,
const raw_json_string a 
)
noexcept

Definition at line 151 of file raw_json_string-inl.h.