Skip to main content

SleepyDiscord::json

Classes​

Name
structSleepyDiscord::json::ArrayStringWrapper
structSleepyDiscord::json::ArrayValueWrapper
structSleepyDiscord::json::ArrayValueWrapper< Type, typename std::enable_if< std::is_constructible< Type, const Value >::value >::type >
structSleepyDiscord::json::ArrayValueWrapper< Type, typename std::enable_if< std::is_constructible< Type, Value >::value >::type >
structSleepyDiscord::json::ArrayWrapper
structSleepyDiscord::json::ArrayWrapper< Value, Base >
structSleepyDiscord::json::BaseEnumTypeHelper
structSleepyDiscord::json::ClassTypeHelper
structSleepyDiscord::json::ClassTypeHelper< bool >
structSleepyDiscord::json::ClassTypeHelper< double >
structSleepyDiscord::json::ClassTypeHelper< float >
structSleepyDiscord::json::ClassTypeHelper< int >
structSleepyDiscord::json::ClassTypeHelper< int64_t >
structSleepyDiscord::json::ClassTypeHelper< nonstd::string_view >
structSleepyDiscord::json::ClassTypeHelper< std::nullptr_t >
structSleepyDiscord::json::ClassTypeHelper< std::shared_ptr< BaseComponent > >
structSleepyDiscord::json::ClassTypeHelper< std::string >
structSleepyDiscord::json::ClassTypeHelper< uint32_t >
structSleepyDiscord::json::ClassTypeHelper< uint64_t >
structSleepyDiscord::json::ClassTypeHelper< Value >
structSleepyDiscord::json::ComplexPair
structSleepyDiscord::json::ContainerTypeHelper
structSleepyDiscord::json::EmptyFunction
structSleepyDiscord::json::EnumTypeHelper
structSleepyDiscord::json::FromContainerFunction
structSleepyDiscord::json::hasIsType
structSleepyDiscord::json::hasSerialize
structSleepyDiscord::json::IsArrayFunction
structSleepyDiscord::json::IsBoolFunction
structSleepyDiscord::json::IsNumberFunction
structSleepyDiscord::json::IsObjectFunction
structSleepyDiscord::json::IsPrimitiveTypeFunction
structSleepyDiscord::json::IsPrimitiveTypeFunction< bool >
structSleepyDiscord::json::IsStringFunction
structSleepyDiscord::json::MapTypeHelper
structSleepyDiscord::json::NullableTypeHelper
structSleepyDiscord::json::OptionalTypeHelper
structSleepyDiscord::json::PairImpl
structSleepyDiscord::json::PrimitiveTypeHelper
structSleepyDiscord::json::SmartPtrTypeHelper
structSleepyDiscord::json::StdArrayTypeHelper
structSleepyDiscord::json::ToContainerFunction

Types​

Name
enumFieldType { REQUIRIED_FIELD = 0, OPTIONAL_FIELD = 1 << 0, NULLABLE_FIELD = 1 << 1, OPTIONAL_NULLABLE_FIELD = OPTIONAL_FIELD
enumFromJSONMode { Default = 0, ReturnOnError = 1}
using rapidjson::ValueValue
using rapidjson::Value::ConstArrayArray
using ValueValues
template <class Return >
using Return(*)(const Value &)
JSONConverter

Functions​

Name
const std::stringcreateJSON(std::initializer_list< std::pair< std::string, std::string >> json)
const std::stringstring(const std::string & s)
const std::stringUInteger(const uint64_t num)
const std::stringoptionalUInteger(const uint64_t num)
const std::stringinteger(const int64_t num)
const std::stringoptionalInteger(const int64_t num)
const std::stringboolean(const bool boolean)
template <class Type >
const std::string
createJSONArray(const std::vector< Type > source)
template <typename T >
constexpr auto
hasPushBack(int )
template <typename T >
constexpr std::false_type
hasPushBack(long )
const Value &leaveAlone(const Value & value)
const char *toString(const Value & value)
std::stringtoStdString(const Value & value)
nonstd::string_viewtoStdStringView(const Value & value)
inttoInt(const Value & value)
unsigned inttoUint(const Value & value)
int64_ttoInt64(const Value & value)
uint64_ttoUint64(const Value & value)
doubletoDouble(const Value & value)
floattoFloat(const Value & value)
booltoBool(const Value & value)
template <class Type ,class Value >
ArrayWrapper< Type, ArrayStringWrapper< Value > >
toArray(Value & value)
template <class Type >
Type
toEnum(const Value & value)
template <class Object >
Value
toJSON(const Object & object, Value::AllocatorType & allocator)
template <int defaultValue,template< class, int > class TypeHelper =PrimitiveTypeHelper,class Class ,class Type >
constexpr PairImpl< Class, Type, TypeHelper< Type, defaultValue > >
pair(Type Class:: member, const char name, FieldType type)
template <template< class > class TypeHelper =ClassTypeHelper,class Class ,class Type >
constexpr PairImpl< Class, Type, TypeHelper< Type > >
pair(Type Class:: member, const char name, FieldType type)
template <template< class, template< class... > class > class TypeHelper,template< class... > class TypeHelper2 =ClassTypeHelper,class Class ,class Type >
constexpr PairImpl< Class, Type, TypeHelper< Type, TypeHelper2 > >
pair(Type Class:: member, const char name, FieldType type)
template <template< class, class > class TypeHelper,template< class, template< class... > class > class TypeHelper2,template< class... > class TypeHelper3,class Class ,class Type ,class Type2 >
constexpr PairImpl< Class, Type, TypeHelper< Type, TypeHelper2< Type2, TypeHelper3 > > >
pair(Type Class:: member, const char name, FieldType type)
template <class Helper ,class ResultingObject ,class Value >
bool
castValue(ResultingObject & result, Value & value)
template <FromJSONMode mode =FromJSONMode::Default,class ResultingObject ,class Value ,size_t i =0>
std::enable_if< i==std::tuple_size< decltype(ResultingObject::JSONStruct)>::value, bool >::type
fromJSON(ResultingObject & , Value & )

Types Documentation​

enum FieldType​

EnumeratorValueDescription
REQUIRIED_FIELD0
OPTIONAL_FIELD1 << 0
NULLABLE_FIELD1 << 1
OPTIONAL_NULLABLE_FIELDOPTIONAL_FIELDNULLABLE_FIELD

enum FromJSONMode​

EnumeratorValueDescription
Default0
ReturnOnError1

using Value​

using SleepyDiscord::json::Value = typedef rapidjson::Value;

using Array​

using SleepyDiscord::json::Array = typedef rapidjson::Value::ConstArray;

using Values​

using SleepyDiscord::json::Values = typedef Value;

using JSONConverter​

template <class Return >
using SleepyDiscord::json::JSONConverter = typedef Return(*)(const Value&);

Functions Documentation​

function createJSON​

const std::string createJSON(
std::initializer_list< std::pair< std::string, std::string >> json
)

function string​

const std::string string(
const std::string & s
)

function UInteger​

const std::string UInteger(
const uint64_t num
)

function optionalUInteger​

const std::string optionalUInteger(
const uint64_t num
)

function integer​

const std::string integer(
const int64_t num
)

function optionalInteger​

const std::string optionalInteger(
const int64_t num
)

function boolean​

const std::string boolean(
const bool boolean
)

function createJSONArray​

template <class Type >
const std::string createJSONArray(
const std::vector< Type > source
)

function hasPushBack​

template <typename T >
constexpr auto hasPushBack(
int
)

function hasPushBack​

template <typename T >
constexpr std::false_type hasPushBack(
long
)

function leaveAlone​

inline const Value & leaveAlone(
const Value & value
)

function toString​

inline const char * toString(
const Value & value
)

function toStdString​

inline std::string toStdString(
const Value & value
)

function toStdStringView​

inline nonstd::string_view toStdStringView(
const Value & value
)

function toInt​

inline int toInt(
const Value & value
)

function toUint​

inline unsigned int toUint(
const Value & value
)

function toInt64​

inline int64_t toInt64(
const Value & value
)

function toUint64​

inline uint64_t toUint64(
const Value & value
)

function toDouble​

inline double toDouble(
const Value & value
)

function toFloat​

inline float toFloat(
const Value & value
)

function toBool​

inline bool toBool(
const Value & value
)

function toArray​

template <class Type ,
class Value >
inline ArrayWrapper< Type, ArrayStringWrapper< Value > > toArray(
Value & value
)

function toEnum​

template <class Type >
inline Type toEnum(
const Value & value
)

function toJSON​

template <class Object >
inline Value toJSON(
const Object & object,
Value::AllocatorType & allocator
)

function pair​

template <int defaultValue,
template< class, int > class TypeHelper =PrimitiveTypeHelper,
class Class ,
class Type >
constexpr PairImpl< Class, Type, TypeHelper< Type, defaultValue > > pair(
Type Class::* member,
const char * name,
FieldType type
)

function pair​

template <template< class > class TypeHelper =ClassTypeHelper,
class Class ,
class Type >
constexpr PairImpl< Class, Type, TypeHelper< Type > > pair(
Type Class::* member,
const char * name,
FieldType type
)

function pair​

template <template< class, template< class... > class > class TypeHelper,
template< class... > class TypeHelper2 =ClassTypeHelper,
class Class ,
class Type >
constexpr PairImpl< Class, Type, TypeHelper< Type, TypeHelper2 > > pair(
Type Class::* member,
const char * name,
FieldType type
)

function pair​

template <template< class, class > class TypeHelper,
template< class, template< class... > class > class TypeHelper2,
template< class... > class TypeHelper3,
class Class ,
class Type ,
class Type2 >
constexpr PairImpl< Class, Type, TypeHelper< Type, TypeHelper2< Type2, TypeHelper3 > > > pair(
Type Class::* member,
const char * name,
FieldType type
)

function castValue​

template <class Helper ,
class ResultingObject ,
class Value >
inline bool castValue(
ResultingObject & result,
Value & value
)

function fromJSON​

template <FromJSONMode mode =FromJSONMode::Default,
class ResultingObject ,
class Value ,
size_t i =0>
inline std::enable_if< i==std::tuple_size< decltype(ResultingObject::JSONStruct)>::value, bool >::type fromJSON(
ResultingObject & ,
Value &
)

Updated on 13 April 2022 at 18:39:59 UTC