neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc > Class Template Reference

#include <json.hpp>

Classes

class  const_iterator
 
class  iterator
 

Public Types

typedef Alloc allocator_type
 
typedef CharT character_type
 
typedef Traits character_traits_type
 
typedef CharAlloc character_allocator_type
 
typedef basic_json_value< syntax, allocator_type, character_type, character_traits_type, character_allocator_typejson_value
 
typedef std::optional< json_valueoptional_json_value
 
typedef json_value::json_object json_object
 
typedef json_value::json_array json_array
 
typedef json_value::json_double json_double
 
typedef json_value::json_int64 json_int64
 
typedef json_value::json_uint64 json_uint64
 
typedef json_value::json_int json_int
 
typedef json_value::json_uint json_uint
 
typedef json_value::json_string json_string
 
typedef json_value::json_bool json_bool
 
typedef json_value::json_null json_null
 
typedef json_value::json_keyword json_keyword
 
typedef json_value::value_type value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 

Public Member Functions

 basic_json ()
 
 basic_json (const std::string &aPath, bool aValidateUtf=false)
 
template<typename Elem , typename ElemTraits >
 basic_json (std::basic_istream< Elem, ElemTraits > &aInput, bool aValidateUtf=false)
 
void clear ()
 
bool read (const std::string &aPath, bool aValidateUtf=false)
 
template<typename Elem , typename ElemTraits >
bool read (std::basic_istream< Elem, ElemTraits > &aInput, bool aValidateUtf=false)
 
bool write (const std::string &aPath, const string_type &aIndent=string_type(2, character_type{' '}))
 
template<typename Elem , typename ElemTraits >
bool write (std::basic_ostream< Elem, ElemTraits > &aOutput, const string_type &aIndent=string_type(2, character_type{' '}))
 
json_encoding encoding () const
 
const json_stringdocument () const
 
const string_type & error_text () const
 
bool has_root () const
 
const json_valuecroot () const
 
const json_valueroot () const
 
json_valueroot ()
 
const json_valueat (const json_string &aPath) const
 
json_valueat (const json_string &aPath)
 
template<typename Visitor >
void visit (Visitor &&aVisitor) const
 
template<typename Visitor >
void visit (Visitor &&aVisitor)
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 

Static Public Member Functions

static string_type to_error_text (const json_document_source_location &aDocumentSourceLocation, const string_type &aExtraInfo={})
 
static string_type to_error_text (const json_value &aNode, const string_type &aExtraInfo={})
 

Static Public Attributes

static constexpr json_syntax syntax = Syntax
 

Detailed Description

template<json_syntax Syntax, typename Alloc, typename CharT, typename Traits, typename CharAlloc>
class neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >

Definition at line 897 of file json.hpp.

Member Typedef Documentation

◆ allocator_type

typedef Alloc neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::allocator_type

Definition at line 902 of file json.hpp.

◆ character_allocator_type

typedef CharAlloc neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::character_allocator_type

Definition at line 905 of file json.hpp.

◆ character_traits_type

typedef Traits neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::character_traits_type

Definition at line 904 of file json.hpp.

◆ character_type

typedef CharT neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::character_type

Definition at line 903 of file json.hpp.

◆ const_pointer

Definition at line 922 of file json.hpp.

◆ const_reference

Definition at line 924 of file json.hpp.

◆ json_array

Definition at line 909 of file json.hpp.

◆ json_bool

Definition at line 916 of file json.hpp.

◆ json_double

Definition at line 910 of file json.hpp.

◆ json_int

Definition at line 913 of file json.hpp.

◆ json_int64

Definition at line 911 of file json.hpp.

◆ json_keyword

Definition at line 918 of file json.hpp.

◆ json_null

Definition at line 917 of file json.hpp.

◆ json_object

Definition at line 908 of file json.hpp.

◆ json_string

Definition at line 915 of file json.hpp.

◆ json_uint

Definition at line 914 of file json.hpp.

◆ json_uint64

Definition at line 912 of file json.hpp.

◆ json_value

◆ optional_json_value

typedef std::optional<json_value> neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::optional_json_value

Definition at line 907 of file json.hpp.

◆ pointer

Definition at line 921 of file json.hpp.

◆ reference

Definition at line 923 of file json.hpp.

◆ value_type

Definition at line 920 of file json.hpp.

Constructor & Destructor Documentation

◆ basic_json() [1/3]

neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::basic_json ( )
inline

Definition at line 1087 of file json.inl.

◆ basic_json() [2/3]

neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::basic_json ( const std::string &  aPath,
bool  aValidateUtf = false 
)
inline

Definition at line 1092 of file json.inl.

◆ basic_json() [3/3]

neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::basic_json ( std::basic_istream< Elem, ElemTraits > &  aInput,
bool  aValidateUtf = false 
)
inline

Definition at line 1100 of file json.inl.

Member Function Documentation

◆ at() [1/2]

Definition at line 1883 of file json.inl.

◆ at() [2/2]

Definition at line 1863 of file json.inl.

◆ begin() [1/2]

basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::iterator neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::begin ( )

Definition at line 1931 of file json.inl.

◆ begin() [2/2]

basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::const_iterator neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::begin ( ) const

Definition at line 1917 of file json.inl.

◆ cbegin()

basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::const_iterator neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::cbegin ( ) const

Definition at line 1905 of file json.inl.

◆ cend()

basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::const_iterator neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::cend ( ) const

Definition at line 1911 of file json.inl.

◆ clear()

void neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::clear ( )
inline

Definition at line 1107 of file json.inl.

◆ croot()

const basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::json_value & neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::croot ( ) const
inline

Definition at line 1843 of file json.inl.

◆ document()

const basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::json_string & neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::document ( ) const
inline

Definition at line 1825 of file json.inl.

◆ encoding()

json_encoding neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::encoding ( ) const
inline

Definition at line 1819 of file json.inl.

◆ end() [1/2]

basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::iterator neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::end ( )

Definition at line 1939 of file json.inl.

◆ end() [2/2]

basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::const_iterator neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::end ( ) const

Definition at line 1925 of file json.inl.

◆ error_text()

const basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::string_type & neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::error_text ( ) const
inline

Definition at line 1831 of file json.inl.

◆ has_root()

bool neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::has_root ( ) const
inline

Definition at line 1837 of file json.inl.

◆ read() [1/2]

bool neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::read ( const std::string &  aPath,
bool  aValidateUtf = false 
)
inline

Definition at line 1126 of file json.inl.

◆ read() [2/2]

bool neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::read ( std::basic_istream< Elem, ElemTraits > &  aInput,
bool  aValidateUtf = false 
)
inline

Definition at line 1144 of file json.inl.

◆ root() [1/2]

Definition at line 1857 of file json.inl.

◆ root() [2/2]

const basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::json_value & neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::root ( ) const
inline

Definition at line 1851 of file json.inl.

◆ to_error_text() [1/2]

basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::string_type neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::to_error_text ( const json_document_source_location aDocumentSourceLocation,
const string_type &  aExtraInfo = {} 
)
static

Definition at line 1945 of file json.inl.

◆ to_error_text() [2/2]

basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::string_type neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::to_error_text ( const json_value aNode,
const string_type &  aExtraInfo = {} 
)
static

Definition at line 1959 of file json.inl.

◆ visit() [1/2]

template<typename Visitor >
void neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::visit ( Visitor &&  aVisitor)
inline

Definition at line 1898 of file json.inl.

◆ visit() [2/2]

template<typename Visitor >
void neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::visit ( Visitor &&  aVisitor) const
inline

Definition at line 1890 of file json.inl.

◆ write() [1/2]

bool neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::write ( const std::string &  aPath,
const string_type &  aIndent = string_type(2, character_type{' '}) 
)
inline

Definition at line 1665 of file json.inl.

◆ write() [2/2]

bool neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::write ( std::basic_ostream< Elem, ElemTraits > &  aOutput,
const string_type &  aIndent = string_type(2, character_type{' '}) 
)
inline

Definition at line 1673 of file json.inl.

Member Data Documentation

◆ syntax

constexpr json_syntax neolib::basic_json< Syntax, Alloc, CharT, Traits, CharAlloc >::syntax = Syntax
staticconstexpr

Definition at line 901 of file json.hpp.


The documentation for this class was generated from the following files: