File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 11{
22 "FileVersion": 3,
33 "Version": 1,
4- "VersionName": "2.9.2 ",
4+ "VersionName": "2.9.3 ",
55 "EngineVersion": "5.5",
66 "FriendlyName": "Socket.IO Client",
77 "Description": "Real-time WebSocket networking via Socket.IO protocol usable from blueprints and c++.",
Original file line number Diff line number Diff line change @@ -1097,3 +1097,15 @@ void USIOJConvert::ReplaceJsonValueNamesWithMap(TSharedPtr<FJsonValue>& JsonValu
10971097 }
10981098 }
10991099}
1100+
1101+ FString USIOJConvert::JsonObjectToString (TSharedPtr<FJsonObject> Object)
1102+ {
1103+ FString JsonString;
1104+ auto JsonWriter = TJsonWriterFactory<TCHAR, TCondensedJsonPrintPolicy<TCHAR>>::Create (&JsonString);
1105+ bool bSerialized = FJsonSerializer::Serialize (Object.ToSharedRef (), JsonWriter);
1106+ if (!bSerialized)
1107+ {
1108+ UE_LOG (LogTemp, Error, TEXT (" Failed to stringify JSON object." ));
1109+ }
1110+ return JsonString;
1111+ }
Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ class SIOJSON_API USIOJConvert : public UObject
7272 static void SetTrimmedKeyMapForStruct (TSharedPtr<FTrimmedKeyMap>& InMap, UStruct* Struct);
7373 static void SetTrimmedKeyMapForProp (TSharedPtr<FTrimmedKeyMap>& InMap, FProperty* ArrayInnerProp);
7474 static void ReplaceJsonValueNamesWithMap (TSharedPtr<FJsonValue>& InValue, TSharedPtr<FTrimmedKeyMap> KeyMap);
75+
76+ // Simple object to string converter
77+ static FString JsonObjectToString (TSharedPtr<FJsonObject> Object);
7578};
7679
7780
You can’t perform that action at this time.
0 commit comments