Stream Chat Unreal SDK
Loading...
Searching...
No Matches
JsonObject Namespace Reference

Conversion to and from dynamic JSON objects. More...

Functions

STREAMJSON_API TSharedRef< FJsonObject > UStructToJsonObject (const UStruct *StructDefinition, const void *Struct, ENamingConvention NamingConvention=ENamingConvention::SnakeCase)
 Converts from a UStruct to a Json Object. More...
 
template<class T >
TSharedRef< FJsonObject > UStructToJsonObject (const T &Struct, ENamingConvention NamingConvention=ENamingConvention::SnakeCase)
 Converts from a UStruct to a Json Object. More...
 
FString STREAMJSON_API JsonObjectToString (const TSharedRef< FJsonObject > &JsonObject)
 

Detailed Description

Conversion to and from dynamic JSON objects.

Function Documentation

◆ UStructToJsonObject() [1/2]

template<class T >
TSharedRef< FJsonObject > JsonObject::UStructToJsonObject ( const T &  Struct,
ENamingConvention  NamingConvention = ENamingConvention::SnakeCase 
)

Converts from a UStruct to a Json Object.

Parameters
StructThe UStruct instance to copy out of
NamingConventionJSON keys and values will be formatted according to this naming convention
Returns
A newly created JSON Object

◆ UStructToJsonObject() [2/2]

TSharedRef< FJsonObject > JsonObject::UStructToJsonObject ( const UStruct *  StructDefinition,
const void *  Struct,
ENamingConvention  NamingConvention = ENamingConvention::SnakeCase 
)

Converts from a UStruct to a Json Object.

Parameters
StructDefinitionUStruct definition that is looked over for properties
StructThe UStruct instance to copy out of
NamingConventionJSON keys and values will be formatted according to this naming convention
Returns
A newly created JSON Object