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

Handles converting UStructs to Json objects. More...

Functions

bool UStructToJsonAttributes (const UStruct *StructDefinition, const void *Struct, TMap< FString, TSharedPtr< FJsonValue > > &OutJsonAttributes, ENamingConvention NamingConvention=ENamingConvention::SnakeCase)
 Converts from a UStruct to a set of json attributes (possibly from within a JsonObject) More...
 
FString STREAMJSON_API UEnumToString (const UEnum *EnumDefinition, int64 Value, ENamingConvention NamingConvention=ENamingConvention::SnakeCase)
 
void STREAMJSON_API SetObjectField (FJsonObject &TargetJsonObject, const FString &FieldName, const TSharedPtr< FJsonObject > &FieldJsonObject)
 
bool STREAMJSON_API TryGetObjectField (const FJsonObject &TargetJsonObject, const FString &FieldName, const TSharedPtr< FJsonObject > *&FieldJsonObject)
 

Detailed Description

Handles converting UStructs to Json objects.

Function Documentation

◆ UStructToJsonAttributes()

bool JsonObjectSerialization::UStructToJsonAttributes ( const UStruct *  StructDefinition,
const void *  Struct,
TMap< FString, TSharedPtr< FJsonValue > > &  OutJsonAttributes,
ENamingConvention  NamingConvention = ENamingConvention::SnakeCase 
)

Converts from a UStruct to a set of json attributes (possibly from within a JsonObject)

Parameters
StructDefinitionUStruct definition that is looked over for properties
StructThe UStruct instance to copy out of
OutJsonAttributesMap of attributes to copy in to
NamingConventionJSON keys and values will be formatted according to this naming convention
Returns
False if any properties failed to write