GRPC C++  1.66.0
Data Structures | Public Types | Public Member Functions | Static Public Member Functions
grpc_core::experimental::Json Class Reference

#include <json.h>

Public Types

enum  Type {
  Type::kNull, Type::kBoolean, Type::kNumber, Type::kString,
  Type::kObject, Type::kArray
}
 
using Object = std::map< std::string, Json >
 
using Array = std::vector< Json >
 

Public Member Functions

 Json ()=default
 
 Json (const Json &other)=default
 
Jsonoperator= (const Json &other)=default
 
 Json (Json &&other) noexcept
 
Jsonoperator= (Json &&other) noexcept
 
Type type () const
 
bool boolean () const
 
const std::string & string () const
 
const Objectobject () const
 
const Arrayarray () const
 
bool operator== (const Json &other) const
 
bool operator!= (const Json &other) const
 

Static Public Member Functions

static Json FromBool (bool b)
 
static Json FromNumber (const std::string &str)
 
static Json FromNumber (const char *str)
 
static Json FromNumber (std::string &&str)
 
static Json FromNumber (int32_t value)
 
static Json FromNumber (uint32_t value)
 
static Json FromNumber (int64_t value)
 
static Json FromNumber (uint64_t value)
 
static Json FromNumber (double value)
 
static Json FromString (const std::string &str)
 
static Json FromString (const char *str)
 
static Json FromString (std::string &&str)
 
static Json FromObject (const Object &object)
 
static Json FromObject (Object &&object)
 
static Json FromArray (const Array &array)
 
static Json FromArray (Array &&array)
 

Member Typedef Documentation

◆ Array

◆ Object

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

Member Enumeration Documentation

◆ Type

Enumerator
kNull 
kBoolean 
kNumber 
kString 
kObject 
kArray 

Constructor & Destructor Documentation

◆ Json() [1/3]

grpc_core::experimental::Json::Json ( )
default

◆ Json() [2/3]

grpc_core::experimental::Json::Json ( const Json other)
default

◆ Json() [3/3]

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

Member Function Documentation

◆ array()

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

◆ boolean()

bool grpc_core::experimental::Json::boolean ( ) const
inline

◆ FromArray() [1/2]

static Json grpc_core::experimental::Json::FromArray ( Array &&  array)
inlinestatic

◆ FromArray() [2/2]

static Json grpc_core::experimental::Json::FromArray ( const Array array)
inlinestatic

◆ FromBool()

static Json grpc_core::experimental::Json::FromBool ( bool  b)
inlinestatic

◆ FromNumber() [1/8]

static Json grpc_core::experimental::Json::FromNumber ( const char *  str)
inlinestatic

◆ FromNumber() [2/8]

static Json grpc_core::experimental::Json::FromNumber ( const std::string &  str)
inlinestatic

◆ FromNumber() [3/8]

static Json grpc_core::experimental::Json::FromNumber ( double  value)
inlinestatic

◆ FromNumber() [4/8]

static Json grpc_core::experimental::Json::FromNumber ( int32_t  value)
inlinestatic

◆ FromNumber() [5/8]

static Json grpc_core::experimental::Json::FromNumber ( int64_t  value)
inlinestatic

◆ FromNumber() [6/8]

static Json grpc_core::experimental::Json::FromNumber ( std::string &&  str)
inlinestatic

◆ FromNumber() [7/8]

static Json grpc_core::experimental::Json::FromNumber ( uint32_t  value)
inlinestatic

◆ FromNumber() [8/8]

static Json grpc_core::experimental::Json::FromNumber ( uint64_t  value)
inlinestatic

◆ FromObject() [1/2]

static Json grpc_core::experimental::Json::FromObject ( const Object object)
inlinestatic

◆ FromObject() [2/2]

static Json grpc_core::experimental::Json::FromObject ( Object &&  object)
inlinestatic

◆ FromString() [1/3]

static Json grpc_core::experimental::Json::FromString ( const char *  str)
inlinestatic

◆ FromString() [2/3]

static Json grpc_core::experimental::Json::FromString ( const std::string &  str)
inlinestatic

◆ FromString() [3/3]

static Json grpc_core::experimental::Json::FromString ( std::string &&  str)
inlinestatic

◆ object()

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

◆ operator!=()

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

◆ operator=() [1/2]

Json& grpc_core::experimental::Json::operator= ( const Json other)
default

◆ operator=() [2/2]

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

◆ operator==()

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

◆ string()

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

◆ type()

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

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