Twitch SDK (Internal)
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize > Class Template Reference

#include <jsonserialization.h>

Public Member Functions

 JsonField (const std::array< const char *, ArraySize > &keyPath, ValueType &object)
 
bool Parse (const ttv::json::Value &parent)
 
bool Emit (ttv::json::Value &parent)
 

Static Public Attributes

static constexpr bool IsRequired = RequiredType::IsRequired
 

Private Member Functions

template<int index>
std::enable_if_t<(index< ArraySize - 1), bool > ParseHelper (const ttv::json::Value &parent)
 
template<int index>
std::enable_if_t<(index==ArraySize - 1), bool > ParseHelper (const ttv::json::Value &parent)
 
template<int index>
std::enable_if_t<(index< ArraySize - 1), bool > EmitHelper (ttv::json::Value &parent)
 
template<int index>
std::enable_if_t<(index==ArraySize - 1), bool > EmitHelper (ttv::json::Value &parent)
 

Private Attributes

std::array< const char *, ArraySize > mKeyPath
 
ValueTypemValue
 

Detailed Description

template<typename ValueType, typename RequiredType, typename SchemaType, size_t ArraySize>
class ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >

A class used by the object schema to map between JSON fields and C++ fields. Instantiating these objects directly is not recommended, use the make_field functions documented below.

Constructor & Destructor Documentation

◆ JsonField()

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::JsonField ( const std::array< const char *, ArraySize > &  keyPath,
ValueType object 
)
inline

Member Function Documentation

◆ Emit()

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
bool ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::Emit ( ttv::json::Value parent)
inline

◆ EmitHelper() [1/2]

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
template<int index>
std::enable_if_t<(index < ArraySize - 1), bool> ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::EmitHelper ( ttv::json::Value parent)
inlineprivate

◆ EmitHelper() [2/2]

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
template<int index>
std::enable_if_t<(index == ArraySize - 1), bool> ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::EmitHelper ( ttv::json::Value parent)
inlineprivate

◆ Parse()

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
bool ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::Parse ( const ttv::json::Value parent)
inline

◆ ParseHelper() [1/2]

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
template<int index>
std::enable_if_t<(index < ArraySize - 1), bool> ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::ParseHelper ( const ttv::json::Value parent)
inlineprivate

◆ ParseHelper() [2/2]

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
template<int index>
std::enable_if_t<(index == ArraySize - 1), bool> ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::ParseHelper ( const ttv::json::Value parent)
inlineprivate

Member Data Documentation

◆ IsRequired

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
constexpr bool ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::IsRequired = RequiredType::IsRequired
static

◆ mKeyPath

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
std::array<const char *, ArraySize> ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::mKeyPath
private

◆ mValue

template<typename ValueType , typename RequiredType , typename SchemaType , size_t ArraySize>
ValueType& ttv::json::JsonField< ValueType, RequiredType, SchemaType, ArraySize >::mValue
private

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