Navigation
API > API/Runtime > API/Runtime/Json
A Json Object is a structure holding an unordered set of name/value pairs. Can use either FString (old) or UE::FSharedString (new) as the key type.
In a Json file, it is represented by everything between curly braces {}.
| Name | FJsonObject |
| Type | class |
| Header File | /Engine/Source/Runtime/Json/Public/Dom/JsonObject.h |
| Include Path | #include "Dom/JsonObject.h" |
Syntax
class FJsonObject : public UE::JSON::Private::FJsonObjectSharedStringStorage
Inheritance Hierarchy
- FJsonObjectSharedStringStorage → FJsonObject
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const TArray< TSharedPtr< FJsonValue > > & GetArrayField
(
FStringView FieldName |
Get the field named FieldName as an array. | Dom/JsonObject.h | |
bool GetBoolField
(
FStringView FieldName |
Gets the field with the specified name as a boolean. | Dom/JsonObject.h | |
TSharedPtr< FJsonValue > GetField
(
FStringView FieldName, |
Dom/JsonObject.h | ||
TSharedPtr< FJsonValue > GetField
(
FStringView FieldName |
Dom/JsonObject.h | ||
const TSharedPtr< FJsonValue > GetFieldUntyped
(
FStringView FieldName |
Gets a shared pointer to a field by name, if it exists. | Dom/JsonObject.h | |
int32 GetIntegerField
(
FStringView FieldName |
Gets a numeric field and casts to an int32 | Dom/JsonObject.h | |
double GetNumberField
(
FStringView FieldName |
Gets the field with the specified name as a number. | Dom/JsonObject.h | |
const TSharedPtr< FJsonObject > & GetObjectField
(
FStringView FieldName |
Gets the field with the specified name as a Json object. | Dom/JsonObject.h | |
FString GetStringField
(
FStringView FieldName |
Get the field named FieldName as a string. | Dom/JsonObject.h | |
FUtf8String GetUtf8StringField
(
FStringView FieldName |
Get the field named FieldName as a UTF8 string. | Dom/JsonObject.h | |
bool HasField
(
FStringView FieldName |
Checks whether a field with the specified name exists in the object. | Dom/JsonObject.h | |
bool HasTypedField
(
FStringView FieldName, |
Checks whether a field with the specified name and type exists in the object. | Dom/JsonObject.h | |
bool HasTypedField
(
FStringView FieldName |
Checks whether a field with the specified name and type exists in the object. | Dom/JsonObject.h | |
void RemoveField
(
FStringView FieldName |
Removes the field with the specified name. | Dom/JsonObject.h | |
void RemoveIf
(
TFunctionRef< bool(const FStringType&, TSharedPtr< const FJsonValue >)> Predicate |
Removes all fields the predicate returns true for. | Dom/JsonObject.h | |
bool TryGetArrayField
(
FStringView FieldName, |
Try to get the field named FieldName as an array, or return false if it's another type | Dom/JsonObject.h | |
bool TryGetBoolField
(
FStringView FieldName, |
Get the field named FieldName as a string. | Dom/JsonObject.h | |
bool TryGetEnumArrayField
(
FStringView FieldName, |
Get the field named FieldName as an array of enums. | Dom/JsonObject.h | |
TSharedPtr< FJsonValue > TryGetField
(
FStringView FieldName |
Attempts to get the field with the specified name. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number, and makes sure it's within uint8 range. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number, and makes sure it's within uint16 range. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number, and makes sure it's within int32 range. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number, and makes sure it's within int16 range. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number, and makes sure it's within uint64 range. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number, and makes sure it's within uint32 range. | Dom/JsonObject.h | |
bool TryGetNumberField
(
FStringView FieldName, |
Get the field named FieldName as a number, and makes sure it's within int8 range. | Dom/JsonObject.h | |
bool TryGetObjectField
(
FStringView FieldName, |
Try to get the field named FieldName as an object, or return false if it's another type | Dom/JsonObject.h | |
bool TryGetStringArrayField
(
FStringView FieldName, |
Get the field named FieldName as an array of strings. | Dom/JsonObject.h | |
bool TryGetStringField
(
FStringView FieldName, |
Get the field named FieldName as a string. | Dom/JsonObject.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void Duplicate
(
const TSharedPtr< const FJsonObject >& Source, |
Dom/JsonObject.h | ||
static void Duplicate
(
const TSharedPtr< FJsonObject >& Source, |
Dom/JsonObject.h |