|
Twitch SDK (Internal)
|
Namespaces | |
| description | |
Typedefs | |
| typedef int32_t | Int |
| typedef uint32_t | UInt |
| typedef int64_t | Int64 |
| typedef uint64_t | UInt64 |
| template<typename ObjectType > | |
| using | DefaultSchema = typename DefaultSchemaProvider< ObjectType >::Type |
Enumerations | |
| enum | ValueType : uint8_t { nullValue = 0, intValue, uintValue, realValue, stringValue, booleanValue, arrayValue, objectValue } |
| Type of the value held by a Value object. More... | |
| enum | CommentPlacement { commentBefore = 0, commentAfterOnSameLine, commentAfter, numberOfCommentPlacement } |
Functions | |
| template<typename ObjectType > | |
| bool | ToJson (const ObjectType &object, ttv::json::Value &value) |
| template<typename ObjectType > | |
| bool | ToJsonString (const ObjectType &object, std::string &jsonString) |
| template<typename ObjectType > | |
| bool | ToObject (const ttv::json::Value &value, ObjectType &object) |
| template<typename ObjectType > | |
| bool | ToObject (const std::string &jsonString, ObjectType &object) |
| template<typename ObjectType > | |
| bool | ToObject (const char *jsonString, ObjectType &object) |
| template<typename EnumType > | |
| auto | make_enum_mapping (const char *string, EnumType value) |
| template<typename SchemaType , typename RequiredType , typename ObjectType > | |
| auto | make_field (const char *key, ObjectType &field) |
| template<typename SchemaType , typename RequiredType , typename ObjectType , size_t ArraySize> | |
| auto | make_field (const std::array< const char *, ArraySize > &keyPath, ObjectType &field) |
| template<typename RequiredType , typename ObjectType > | |
| auto | make_field (const char *key, ObjectType &field) |
| template<typename RequiredType , typename ObjectType , size_t ArraySize> | |
| auto | make_field (const std::array< const char *, ArraySize > &keyPath, ObjectType &field) |
| template<typename ObjectType > | |
| auto | make_field (const char *key, ObjectType &field) |
| template<typename ObjectType , size_t ArraySize> | |
| auto | make_field (const std::array< const char *, ArraySize > &keyPath, ObjectType &field) |
| template<typename ... Args> | |
| std::array< const char *, sizeof...(Args)> | MakeKeyPath (Args... args) |
| std::istream & | operator>> (std::istream &, Value &) |
| Read from 'sin' into 'root'. More... | |
| std::string JSON_API | valueToString (Int value) |
| std::string JSON_API | valueToString (UInt value) |
| std::string JSON_API | valueToString (Int64 value) |
| std::string JSON_API | valueToString (UInt64 value) |
| std::string JSON_API | valueToString (double value) |
| std::string JSON_API | valueToString (bool value) |
| std::string JSON_API | valueToQuotedString (const char *value) |
| std::ostream & | operator<< (std::ostream &, const Value &root) |
| Output using the StyledStreamWriter. More... | |
| struct ttv::json::DefaultSchemaProvider |
Partial specializations of the DefaultSchemaProvider struct provide the default schema for a given type. These specializations conform to the following concept:
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.
| struct ttv::json::DefaultSchemaProvider< bool > |
| Class Members | ||
|---|---|---|
| typedef BooleanSchema | Type | |
| struct ttv::json::DefaultSchemaProvider< FloatingPointType, std::enable_if_t< std::is_floating_point< FloatingPointType >::value > > |
| Class Members | ||
|---|---|---|
| typedef FloatingPointSchema | Type | |
| struct ttv::json::DefaultSchemaProvider< IntegralType, std::enable_if_t< std::is_integral< IntegralType >::value > > |
| Class Members | ||
|---|---|---|
| typedef IntegerSchema | Type | |
| struct ttv::json::DefaultSchemaProvider< std::string > |
| Class Members | ||
|---|---|---|
| typedef StringSchema | Type | |
| struct ttv::json::DefaultSchemaProvider< std::vector< ElementType > > |
| Class Members | ||
|---|---|---|
|
typedef ArraySchema < DefaultSchema< ElementType > , ElementType > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::BroadcasterType > |
| Class Members | ||
|---|---|---|
|
typedef EnumSchema < BroadcasterType > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::BroadcastPlatform > |
| Class Members | ||
|---|---|---|
|
typedef EnumSchema < BroadcastPlatform > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::ChannelInfo > |
| Class Members | ||
|---|---|---|
| typedef ObjectSchema< ChannelInfo > | Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::BanUserError > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < BanUserError > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::BitsSentEvent > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < PubSubBitsSentEvent > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::CreateRoomError > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < CreateRoomError > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::Emoticon > |
| Class Members | ||
|---|---|---|
| typedef ObjectSchema< Emoticon > | Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::GraphQLErrorCode > |
| Class Members | ||
|---|---|---|
|
typedef EnumSchema < GraphQLErrorCode > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::HostTargetChange > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < PubSubHostTargetChange > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::RoomMentionInfo > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < ChatRoomMentionInfo > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::RoomRole > |
| Class Members | ||
|---|---|---|
| typedef EnumSchema< ChatRoomRole > | Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::SendRoomMessageError > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < SendRoomMessageError > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::UnbanUserError > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < UnbanUserError > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::UpdateRoomError > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < UpdateRoomError > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::chat::UpdateRoomModesError > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < UpdateRoomModesError > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::PreviewImages > |
| Class Members | ||
|---|---|---|
|
typedef ObjectSchema < PreviewImages > |
Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::StreamInfo > |
| Class Members | ||
|---|---|---|
| typedef ObjectSchema< StreamInfo > | Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::StreamType > |
| Class Members | ||
|---|---|---|
| typedef EnumSchema< StreamType > | Type | |
| struct ttv::json::DefaultSchemaProvider< ttv::UserInfo > |
| Class Members | ||
|---|---|---|
| typedef ObjectSchema< UserInfo > | Type | |
| using ttv::json::DefaultSchema = typedef typename DefaultSchemaProvider<ObjectType>::Type |
A convenience alias to make for easier syntax when getting the DefaultSchema for a type.
| typedef int32_t ttv::json::Int |
| typedef int64_t ttv::json::Int64 |
| typedef uint32_t ttv::json::UInt |
| typedef uint64_t ttv::json::UInt64 |
| enum ttv::json::ValueType : uint8_t |
Type of the value held by a Value object.
| auto ttv::json::make_enum_mapping | ( | const char * | string, |
| EnumType | value | ||
| ) |
Create an EnumMapping between a string value expected in JSON and the corresponding enumeration value.
| string | The expected string to find in JSON. |
| value | The corresponding enumeration value. |
| auto ttv::json::make_field | ( | const char * | key, |
| ObjectType & | field | ||
| ) |
Create a JSONField explicitly defining the schema to use and whether the field is required.
| RequiredType | Used to specify if parsing should be aborted if this field fails to parse. Should be of type RequiredField or OptionalField. |
| SchemaType | The scheme used to serialize or deserialize. |
| ObjectType | The C++ object type to bind to (automatically inferred from arguments). |
| auto ttv::json::make_field | ( | const std::array< const char *, ArraySize > & | keyPath, |
| ObjectType & | field | ||
| ) |
| auto ttv::json::make_field | ( | const char * | key, |
| ObjectType & | field | ||
| ) |
Create a JSONField with the default schema and explicitly define whether it is required.
| Required | Used to specify if parsing should be aborted if this field fails to parse. |
| ObjectType | The C++ object type to bind to (automatically inferred from arguments). |
| auto ttv::json::make_field | ( | const std::array< const char *, ArraySize > & | keyPath, |
| ObjectType & | field | ||
| ) |
| auto ttv::json::make_field | ( | const char * | key, |
| ObjectType & | field | ||
| ) |
Create a JSONField with the default schema that is not required.
| ObjectType | The C++ object type to bind to (automatically inferred from arguments). |
| auto ttv::json::make_field | ( | const std::array< const char *, ArraySize > & | keyPath, |
| ObjectType & | field | ||
| ) |
| std::array< const char *, sizeof...(Args)> ttv::json::MakeKeyPath | ( | Args... | args | ) |
Helper function to create an array of proper size based on the number of key path values passed in.
| std::ostream& ttv::json::operator<< | ( | std::ostream & | , |
| const Value & | root | ||
| ) |
Output using the StyledStreamWriter.
| std::istream& ttv::json::operator>> | ( | std::istream & | , |
| Value & | |||
| ) |
Read from 'sin' into 'root'.
Always keep comments from the input JSON.
This can be used to read a file into a particular sub-object. For example:
Result:
{
"dir": {
"file": {
// The input stream JSON would be nested here.
}
}
}
| std::exception | on parse error. |
| bool ttv::json::ToJson | ( | const ObjectType & | object, |
| ttv::json::Value & | value | ||
| ) |
Public convenience functions for serializing and unserializing objects using the default schema for the passed-in object. Translates an object into JSON using its default schema.
| [in] | object | The input object to serialize into JSON. |
| [out] | value | The output JSON value, or a null value if parsing failed. |
| bool ttv::json::ToJsonString | ( | const ObjectType & | object, |
| std::string & | jsonString | ||
| ) |
Translates an object into a JSON string using the default schema.
| [in] | object | The input object to serialize into JSON. |
| [out] | jsonString | The output JSON string. This value is not modified if parsing fails. |
| bool ttv::json::ToObject | ( | const ttv::json::Value & | value, |
| ObjectType & | object | ||
| ) |
Deserializes JSON into an object using the object's default schema.
| [in] | value | The JSON value to deserialize. |
| [out] | object | The deserialized object, or a default constructed object if the parsing fails. |
| bool ttv::json::ToObject | ( | const std::string & | jsonString, |
| ObjectType & | object | ||
| ) |
Deserializes JSON into an object using the object's default schema.
| [in] | jsonString | The JSON string to deserialize. |
| [out] | object | The deserialized object, or a default constructed object if the parsing fails. |
| bool ttv::json::ToObject | ( | const char * | jsonString, |
| ObjectType & | object | ||
| ) |
Deserializes JSON into an object using the object's default schema.
| [in] | jsonString | The null-terminated JSON string to deserialize. |
| [out] | object | The deserialized object, or a default constructed object if the parsing fails. |
| std::string JSON_API ttv::json::valueToQuotedString | ( | const char * | value | ) |
| std::string JSON_API ttv::json::valueToString | ( | double | value | ) |
| std::string JSON_API ttv::json::valueToString | ( | bool | value | ) |
1.8.13