GRPC C++  1.39.1
Public Types | Public Member Functions | Static Public Member Functions
grpc_core::Json Class Reference

#include <json.h>

Public Types

enum class  Type {
  JSON_NULL , JSON_TRUE , JSON_FALSE , NUMBER ,
  STRING , OBJECT , ARRAY
}
 
using Object = std::map< std::string, Json >
 
using Array = std::vector< Json >
 

Public Member Functions

 Json ()=default
 
 Json (const Json &other)
 
Jsonoperator= (const Json &other)
 
 Json (Json &&other) noexcept
 
Jsonoperator= (Json &&other) noexcept
 
 Json (const std::string &string, bool is_number=false)
 
Jsonoperator= (const std::string &string)
 
 Json (const char *string, bool is_number=false)
 
Jsonoperator= (const char *string)
 
 Json (char *string, bool is_number=false)
 
Jsonoperator= (char *string)
 
 Json (std::string &&string)
 
Jsonoperator= (std::string &&string)
 
 Json (bool b)
 
Jsonoperator= (bool b)
 
template<typename NumericType >
 Json (NumericType number)
 
template<typename NumericType >
Jsonoperator= (NumericType number)
 
 Json (const Object &object)
 
Jsonoperator= (const Object &object)
 
 Json (Object &&object)
 
Jsonoperator= (Object &&object)
 
 Json (const Array &array)
 
Jsonoperator= (const Array &array)
 
 Json (Array &&array)
 
Jsonoperator= (Array &&array)
 
std::string Dump (int indent=0) const
 
Type type () const
 
const std::string & string_value () const
 
std::string * mutable_string_value ()
 
const Objectobject_value () const
 
Objectmutable_object ()
 
const Arrayarray_value () const
 
Arraymutable_array ()
 
bool operator== (const Json &other) const
 
bool operator!= (const Json &other) const
 

Static Public Member Functions

static Json Parse (absl::string_view json_str, grpc_error_handle *error)
 

Member Typedef Documentation

◆ Array

using grpc_core::Json::Array = std::vector<Json>

◆ Object

using grpc_core::Json::Object = std::map<std::string, Json>

Member Enumeration Documentation

◆ Type

enum grpc_core::Json::Type
strong
Enumerator
JSON_NULL 
JSON_TRUE 
JSON_FALSE 
NUMBER 
STRING 
OBJECT 
ARRAY 

Constructor & Destructor Documentation

◆ Json() [1/13]

grpc_core::Json::Json ( )
default

◆ Json() [2/13]

grpc_core::Json::Json ( const Json other)
inline

◆ Json() [3/13]

grpc_core::Json::Json ( Json &&  other)
inlinenoexcept

◆ Json() [4/13]

grpc_core::Json::Json ( const std::string &  string,
bool  is_number = false 
)
inline

◆ Json() [5/13]

grpc_core::Json::Json ( const char *  string,
bool  is_number = false 
)
inline

◆ Json() [6/13]

grpc_core::Json::Json ( char *  string,
bool  is_number = false 
)
inline

◆ Json() [7/13]

grpc_core::Json::Json ( std::string &&  string)
inline

◆ Json() [8/13]

grpc_core::Json::Json ( bool  b)
inline

◆ Json() [9/13]

template<typename NumericType >
grpc_core::Json::Json ( NumericType  number)
inline

◆ Json() [10/13]

grpc_core::Json::Json ( const Object object)
inline

◆ Json() [11/13]

grpc_core::Json::Json ( Object &&  object)
inline

◆ Json() [12/13]

grpc_core::Json::Json ( const Array array)
inline

◆ Json() [13/13]

grpc_core::Json::Json ( Array &&  array)
inline

Member Function Documentation

◆ array_value()

const Array& grpc_core::Json::array_value ( ) const
inline

◆ Dump()

std::string grpc_core::Json::Dump ( int  indent = 0) const

◆ mutable_array()

Array* grpc_core::Json::mutable_array ( )
inline

◆ mutable_object()

Object* grpc_core::Json::mutable_object ( )
inline

◆ mutable_string_value()

std::string* grpc_core::Json::mutable_string_value ( )
inline

◆ object_value()

const Object& grpc_core::Json::object_value ( ) const
inline

◆ operator!=()

bool grpc_core::Json::operator!= ( const Json other) const
inline

◆ operator=() [1/12]

Json& grpc_core::Json::operator= ( Array &&  array)
inline

◆ operator=() [2/12]

Json& grpc_core::Json::operator= ( bool  b)
inline

◆ operator=() [3/12]

Json& grpc_core::Json::operator= ( char *  string)
inline

◆ operator=() [4/12]

Json& grpc_core::Json::operator= ( const Array array)
inline

◆ operator=() [5/12]

Json& grpc_core::Json::operator= ( const char *  string)
inline

◆ operator=() [6/12]

Json& grpc_core::Json::operator= ( const Json other)
inline

◆ operator=() [7/12]

Json& grpc_core::Json::operator= ( const Object object)
inline

◆ operator=() [8/12]

Json& grpc_core::Json::operator= ( const std::string &  string)
inline

◆ operator=() [9/12]

Json& grpc_core::Json::operator= ( Json &&  other)
inlinenoexcept

◆ operator=() [10/12]

template<typename NumericType >
Json& grpc_core::Json::operator= ( NumericType  number)
inline

◆ operator=() [11/12]

Json& grpc_core::Json::operator= ( Object &&  object)
inline

◆ operator=() [12/12]

Json& grpc_core::Json::operator= ( std::string &&  string)
inline

◆ operator==()

bool grpc_core::Json::operator== ( const Json other) const
inline

◆ Parse()

Json grpc_core::Json::Parse ( absl::string_view  json_str,
grpc_error_handle error 
)
static

◆ string_value()

const std::string& grpc_core::Json::string_value ( ) const
inline

◆ type()

Type grpc_core::Json::type ( ) const
inline

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