UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
JsonDataBag.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "Misc/Optional.h"
7
9
14{
15 JSON_API virtual void Serialize(FJsonSerializerBase& Serializer, bool bFlatObject) override;
16
17 JSON_API double GetDouble(const FString& Key) const;
18
19 JSON_API FString GetString(const FString& Key) const;
20
21 JSON_API bool GetBool(const FString& Key) const;
22
23 JSON_API TSharedPtr<const FJsonValue> GetField(const FString& Key) const;
24
25 template<typename JSON_TYPE, typename Arg>
26 void SetField(const FString& Key, Arg&& Value)
27 {
29 }
30
31 JSON_API void SetFieldJson(const FString& Key, const TSharedPtr<FJsonValue>& Value);
32public:
34
35 /* If set, will use TPrettyJsonPrintPolicy */
37};
38
39template<int32 PrintIndentCount>
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition JsonSerializerReader.h:12
Definition SharedPointer.h:692
Definition JsonDataBag.h:14
JSON_API double GetDouble(const FString &Key) const
Definition JsonDataBag.cpp:100
TOptional< int32 > NumPrintIndents
Definition JsonDataBag.h:36
JSON_API bool GetBool(const FString &Key) const
Definition JsonDataBag.cpp:112
TSharedPtr< FJsonObject > JsonObject
Definition JsonDataBag.h:33
JSON_API TSharedPtr< const FJsonValue > GetField(const FString &Key) const
Definition JsonDataBag.cpp:118
JSON_API FString GetString(const FString &Key) const
Definition JsonDataBag.cpp:106
JSON_API void SetFieldJson(const FString &Key, const TSharedPtr< FJsonValue > &Value)
Definition JsonDataBag.cpp:127
void SetField(const FString &Key, Arg &&Value)
Definition JsonDataBag.h:26
Definition JsonSerializable.h:17
Definition JsonSerializerBase.h:12
Definition Optional.h:131
OptionalType & Emplace(ArgsType &&... Args)
Definition Optional.h:323
Definition JsonDataBag.h:41
TPrettyJsonBag()
Definition JsonDataBag.h:42