Stream Chat Unreal SDK
Loading...
Searching...
No Matches
JsonObjectSerialization.h
1// Copyright 2026 Stream.IO, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Detail/JsonAttributes.h"
7#include "NamingConvention.h"
8
9class FJsonValue;
10
16{
28 const UStruct* StructDefinition,
29 const void* Struct,
30 FJsonAttributeMap& OutJsonAttributes,
31 ENamingConvention NamingConvention = ENamingConvention::SnakeCase);
32
33FString STREAMJSON_API UEnumToString(const UEnum* EnumDefinition, int64 Value, ENamingConvention NamingConvention = ENamingConvention::SnakeCase);
34
35void STREAMJSON_API SetObjectField(FJsonObject& TargetJsonObject, const FString& FieldName, const TSharedPtr<FJsonObject>& FieldJsonObject);
36bool STREAMJSON_API TryGetObjectField(const FJsonObject& TargetJsonObject, const FString& FieldName, const TSharedPtr<FJsonObject>*& FieldJsonObject);
37} // namespace JsonObjectSerialization
TMap< FJsonAttributeKey, TSharedPtr< FJsonValue > > FJsonAttributeMap
The attributes of a json object, as stored in FJsonObject::Values.
Definition JsonAttributes.h:31
Handles converting UStructs to Json objects.
Definition JsonObjectSerialization.h:16
bool UStructToJsonAttributes(const UStruct *StructDefinition, const void *Struct, FJsonAttributeMap &OutJsonAttributes, ENamingConvention NamingConvention=ENamingConvention::SnakeCase)
Converts from a UStruct to a set of json attributes (possibly from within a JsonObject)
Definition JsonObjectSerialization.cpp:74