GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
json::JSON Class Reference

#include <json.hpp>

Classes

class  JSONWrapper
class  JSONConstWrapper

Public Types

enum class  Class {
  Null , Object , Array , String ,
  Floating , Integral , Boolean
}

Public Member Functions

 JSON ()=default
 JSON (std::nullptr_t)
 JSON (ClassClass type)
 JSON (initializer_list< JSON > list)
template<typename T>
 JSON (T b, typename enable_if< is_same< T, bool >::value >::type *=nullptr)
template<typename T>
 JSON (T i, typename enable_if< is_integral< T >::value &&!is_same< T, bool >::value >::type *=nullptr)
template<typename T>
 JSON (T f, typename enable_if< is_floating_point< T >::value >::type *=nullptr)
template<typename T>
 JSON (T s, typename enable_if< is_convertible< T, std::string >::value >::type *=nullptr)
JSON & operator[] (const std::string &key)
JSON & operator[] (const size_t index)
JSON & at (const std::string &key)
const JSON & at (const std::string &key) const
JSON & at (size_t index)
const JSON & at (size_t index) const
long length () const
bool has_key (const std::string &key) const
int size () const
ClassClass JSONType () const
bool is_null () const
 Functions for getting primitives from the JSON object.
std::string to_string () const
std::string to_string (bool &ok) const
double to_float () const
double to_float (bool &ok) const
int64_t to_int () const
int64_t to_int (bool &ok) const
bool to_bool () const
bool to_bool (bool &ok) const
JSONWrapper< QuickFlatMap > object_range ()
JSONWrapper< std::vector< JSON > > array_range ()
JSONConstWrapper< QuickFlatMap > object_range () const
JSONConstWrapper< std::vector< JSON > > array_range () const
std::string dump (long depth=1, std::string tab=" ") const

Static Public Member Functions

static JSON Load (const std::string &)

Member Enumeration Documentation

◆ Class

enum class json::JSON::Class
strong
Enumerator
Null 
Object 
Array 
String 
Floating 
Integral 
Boolean 

Constructor & Destructor Documentation

◆ JSON() [1/8]

json::JSON::JSON ( )
default
Here is the caller graph for this function:

◆ JSON() [2/8]

json::JSON::JSON ( std::nullptr_t )
inline

◆ JSON() [3/8]

json::JSON::JSON ( ClassClass type)
inlineexplicit

◆ JSON() [4/8]

json::JSON::JSON ( initializer_list< JSON > list)
inline

◆ JSON() [5/8]

template<typename T>
json::JSON::JSON ( T b,
typename enable_if< is_same< T, bool >::value >::type * = nullptr )
inlineexplicit

◆ JSON() [6/8]

template<typename T>
json::JSON::JSON ( T i,
typename enable_if< is_integral< T >::value &&!is_same< T, bool >::value >::type * = nullptr )
inlineexplicit

◆ JSON() [7/8]

template<typename T>
json::JSON::JSON ( T f,
typename enable_if< is_floating_point< T >::value >::type * = nullptr )
inlineexplicit

◆ JSON() [8/8]

template<typename T>
json::JSON::JSON ( T s,
typename enable_if< is_convertible< T, std::string >::value >::type * = nullptr )
inlineexplicit

Member Function Documentation

◆ array_range() [1/2]

JSONWrapper< std::vector< JSON > > json::JSON::array_range ( )
inline

◆ array_range() [2/2]

JSONConstWrapper< std::vector< JSON > > json::JSON::array_range ( ) const
inline

◆ at() [1/4]

JSON & json::JSON::at ( const std::string & key)
inline
Here is the caller graph for this function:

◆ at() [2/4]

const JSON & json::JSON::at ( const std::string & key) const
inline

◆ at() [3/4]

JSON & json::JSON::at ( size_t index)
inline

◆ at() [4/4]

const JSON & json::JSON::at ( size_t index) const
inline

◆ dump()

std::string json::JSON::dump ( long depth = 1,
std::string tab = "  " ) const
inline

◆ has_key()

bool json::JSON::has_key ( const std::string & key) const
inline

◆ is_null()

bool json::JSON::is_null ( ) const
inline

Functions for getting primitives from the JSON object.

◆ JSONType()

ClassClass json::JSON::JSONType ( ) const
inline

◆ length()

long json::JSON::length ( ) const
inline

◆ Load()

JSON json::JSON::Load ( const std::string & str)
inlinestatic

◆ object_range() [1/2]

JSONWrapper< QuickFlatMap > json::JSON::object_range ( )
inline

◆ object_range() [2/2]

JSONConstWrapper< QuickFlatMap > json::JSON::object_range ( ) const
inline

◆ operator[]() [1/2]

JSON & json::JSON::operator[] ( const size_t index)
inline

◆ operator[]() [2/2]

JSON & json::JSON::operator[] ( const std::string & key)
inline
Here is the caller graph for this function:

◆ size()

int json::JSON::size ( ) const
inline

◆ to_bool() [1/2]

bool json::JSON::to_bool ( ) const
inline
Here is the caller graph for this function:

◆ to_bool() [2/2]

bool json::JSON::to_bool ( bool & ok) const
inline

◆ to_float() [1/2]

double json::JSON::to_float ( ) const
inline
Here is the caller graph for this function:

◆ to_float() [2/2]

double json::JSON::to_float ( bool & ok) const
inline

◆ to_int() [1/2]

int64_t json::JSON::to_int ( ) const
inline
Here is the caller graph for this function:

◆ to_int() [2/2]

int64_t json::JSON::to_int ( bool & ok) const
inline

◆ to_string() [1/2]

std::string json::JSON::to_string ( ) const
inline
Here is the caller graph for this function:

◆ to_string() [2/2]

std::string json::JSON::to_string ( bool & ok) const
inline

The documentation for this class was generated from the following file:
  • chai/ChaiScript-6.1.0/include/chaiscript/utility/json.hpp