Twitch SDK (Internal)
Classes | Namespaces | Typedefs | Functions
jsonserialization.h File Reference
#include "twitchsdk/core/json/value.h"
#include "twitchsdk/core/json/reader.h"
#include "twitchsdk/core/json/writer.h"
#include "twitchsdk/core/json/corejsonutil.h"
#include "twitchsdk/core/types/coretypes.h"
#include "twitchsdk/core/stringutilities.h"

Go to the source code of this file.

Classes

struct  ttv::json::ArraySchema< ElementSchema, ElementType >
 
struct  ttv::json::EnumSchema< EnumDescription >
 
class  ttv::json::EnumMapping< EnumType >
 
struct  ttv::json::ObjectSchema< ObjectDescription >
 
class  ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >
 
struct  ttv::json::DefaultSchemaProvider< ObjectType, Enable >
 
struct  ttv::json::IntegerSchema
 
struct  ttv::json::FloatingPointSchema
 
struct  ttv::json::StringSchema
 
struct  ttv::json::BooleanSchema
 
struct  ttv::json::DateSchema
 
struct  ttv::json::ColorSchema
 
struct  ttv::json::ArraySchema< ElementSchema, ElementType >
 
struct  ttv::json::EnumSchema< EnumDescription >
 
class  ttv::json::EnumMapping< EnumType >
 
struct  ttv::json::ObjectSchema< ObjectDescription >
 
struct  ttv::json::RequiredField
 
struct  ttv::json::OptionalField
 
class  ttv::json::JsonField< ValueType, RequiredType, SchemaType, 1 >
 
class  ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >
 
struct  ttv::json::DefaultSchemaProvider< ObjectType, Enable >
 
struct  ttv::json::DefaultSchemaProvider< IntegralType, std::enable_if_t< std::is_integral< IntegralType >::value > >
 
struct  ttv::json::DefaultSchemaProvider< FloatingPointType, std::enable_if_t< std::is_floating_point< FloatingPointType >::value > >
 
struct  ttv::json::DefaultSchemaProvider< std::string >
 
struct  ttv::json::DefaultSchemaProvider< bool >
 
struct  ttv::json::DefaultSchemaProvider< std::vector< ElementType > >
 

Namespaces

 ttv
 JSON (JavaScript Object Notation).
 
 ttv::json
 

Typedefs

template<typename ObjectType >
using ttv::json::DefaultSchema = typename DefaultSchemaProvider< ObjectType >::Type
 

Functions

template<typename ObjectType >
bool ttv::json::ToJson (const ObjectType &object, ttv::json::Value &value)
 
template<typename ObjectType >
bool ttv::json::ToJsonString (const ObjectType &object, std::string &jsonString)
 
template<typename ObjectType >
bool ttv::json::ToObject (const ttv::json::Value &value, ObjectType &object)
 
template<typename ObjectType >
bool ttv::json::ToObject (const std::string &jsonString, ObjectType &object)
 
template<typename ObjectType >
bool ttv::json::ToObject (const char *jsonString, ObjectType &object)
 
template<typename EnumType >
auto ttv::json::make_enum_mapping (const char *string, EnumType value)
 
template<typename SchemaType , typename RequiredType , typename ObjectType >
auto ttv::json::make_field (const char *key, ObjectType &field)
 
template<typename SchemaType , typename RequiredType , typename ObjectType , size_t ArraySize>
auto ttv::json::make_field (const std::array< const char *, ArraySize > &keyPath, ObjectType &field)
 
template<typename RequiredType , typename ObjectType >
auto ttv::json::make_field (const char *key, ObjectType &field)
 
template<typename RequiredType , typename ObjectType , size_t ArraySize>
auto ttv::json::make_field (const std::array< const char *, ArraySize > &keyPath, ObjectType &field)
 
template<typename ObjectType >
auto ttv::json::make_field (const char *key, ObjectType &field)
 
template<typename ObjectType , size_t ArraySize>
auto ttv::json::make_field (const std::array< const char *, ArraySize > &keyPath, ObjectType &field)
 
template<typename ... Args>
std::array< const char *, sizeof...(Args)> ttv::json::MakeKeyPath (Args... args)
 

Class Documentation

◆ ttv::json::DefaultSchemaProvider

struct ttv::json::DefaultSchemaProvider

template<typename ObjectType, typename Enable>
struct ttv::json::DefaultSchemaProvider< ObjectType, Enable >

Partial specializations of the DefaultSchemaProvider struct provide the default schema for a given type. These specializations conform to the following concept:

template <typename ObjectType>
struct DefaultSchemaProvider
{
using Type = SchemaType;
};

Where ObjectType is the type to serialize/deserialize, and the SchemaType is the desired schema to use by default for serializing and deserializing objects of ObjectType.

◆ ttv::json::DefaultSchemaProvider

struct ttv::json::DefaultSchemaProvider

template<typename ObjectType, typename Enable>
struct ttv::json::DefaultSchemaProvider< ObjectType, Enable >

Partial specializations of the DefaultSchemaProvider struct provide the default schema for a given type. These specializations conform to the following concept:

template <typename ObjectType>
struct DefaultSchemaProvider
{
using Type = SchemaType;
};

Where ObjectType is the type to serialize/deserialize, and the SchemaType is the desired schema to use by default for serializing and deserializing objects of ObjectType.

◆ ttv::json::DefaultSchemaProvider< IntegralType, std::enable_if_t< std::is_integral< IntegralType >::value > >

struct ttv::json::DefaultSchemaProvider< IntegralType, std::enable_if_t< std::is_integral< IntegralType >::value > >

template<typename IntegralType>
struct ttv::json::DefaultSchemaProvider< IntegralType, std::enable_if_t< std::is_integral< IntegralType >::value > >

Class Members
typedef IntegerSchema Type

◆ ttv::json::DefaultSchemaProvider< FloatingPointType, std::enable_if_t< std::is_floating_point< FloatingPointType >::value > >

struct ttv::json::DefaultSchemaProvider< FloatingPointType, std::enable_if_t< std::is_floating_point< FloatingPointType >::value > >

template<typename FloatingPointType>
struct ttv::json::DefaultSchemaProvider< FloatingPointType, std::enable_if_t< std::is_floating_point< FloatingPointType >::value > >

Class Members
typedef FloatingPointSchema Type

◆ ttv::json::DefaultSchemaProvider< std::string >

struct ttv::json::DefaultSchemaProvider< std::string >

template<>
struct ttv::json::DefaultSchemaProvider< std::string >

Class Members
typedef StringSchema Type

◆ ttv::json::DefaultSchemaProvider< bool >

struct ttv::json::DefaultSchemaProvider< bool >

template<>
struct ttv::json::DefaultSchemaProvider< bool >

Class Members
typedef BooleanSchema Type

◆ ttv::json::DefaultSchemaProvider< std::vector< ElementType > >

struct ttv::json::DefaultSchemaProvider< std::vector< ElementType > >

template<typename ElementType>
struct ttv::json::DefaultSchemaProvider< std::vector< ElementType > >

Class Members
typedef ArraySchema
< DefaultSchema< ElementType >
, ElementType >
Type