FJsonObject

A Json Object is a structure holding an unordered set of name/value pairs.

Windows
MacOS
Linux

References

Module

Json

Header

/Engine/Source/Runtime/Json/Public/Dom/JsonObject.h

Include

#include "Dom/JsonObject.h"

Syntax

class FJsonObject

Remarks

A Json Object is a structure holding an unordered set of name/value pairs. In a Json file, it is represented by everything between curly braces {}.

Variables

Name Description

Public variable

TMap< FString, TSharedPtr< FJsonValue > >

 

Values

Functions

Name Description

Public function Const

const TArray< TSharedPtr< FJsonValue > > &

 

GetArrayField

(
    const FString& FieldName
)

Get the field named FieldName as an array.

Public function Const

bool

 

GetBoolField

(
    const FString& FieldName
)

Gets the field with the specified name as a boolean.

Public function Const

TSharedPtr< FJsonValue >

 

GetField

(
    const FString& FieldName
)

Public function Const

int32

 

GetIntegerField

(
    const FString& FieldName
)

Gets a numeric field and casts to an int32

Public function Const

double

 

GetNumberField

(
    const FString& FieldName
)

Gets the field with the specified name as a number.

Public function Const

const TSharedPtr< FJsonObject > &

 

GetObjectField

(
    const FString& FieldName
)

Gets the field with the specified name as a Json object.

Public function Const

FString

 

GetStringField

(
    const FString& FieldName
)

Get the field named FieldName as a string.

Public function Const

bool

 

HasField

(
    const FString& FieldName
)

Checks whether a field with the specified name exists in the object.

Public function Const

bool

 

HasTypedField

(
    const FString& FieldName
)

Checks whether a field with the specified name and type exists in the object.

Public function

void

 

RemoveField

(
    const FString& FieldName
)

Removes the field with the specified name.

Public function

void

 

SetArrayField

(
    const FString& FieldName,
    const TArray< TSharedPtr< FJsonValue > >& Array
)

Set an array field named FieldName and value of Array

Public function

void

 

SetBoolField

(
    const FString& FieldName,
    bool InValue
)

Set a boolean field named FieldName and value of InValue

Public function

void

 

SetField

(
    const FString& FieldName,
    const TSharedPtr< FJsonValue >& Value
)

Sets the value of the field with the specified name.

Public function

void

 

SetNumberField

(
    const FString& FieldName,
    double Number
)

Add a field named FieldName with Number as value

Public function

void

 

SetObjectField

(
    const FString& FieldName,
    const TSharedPtr< FJsonObject >& JsonObject
)

Set an ObjectField named FieldName and value of JsonObject

Public function

void

 

SetStringField

(
    const FString& FieldName,
    const FString& StringValue
)

Add a field named FieldName with value of StringValue

Public function Const

bool

 

TryGetArrayField

(
    const FString& FieldName,
    const TArray< TSharedPtr< FJsonValue > >*& OutArray
)

Try to get the field named FieldName as an array, or return false if it's another type

Public function Const

bool

 

TryGetBoolField

(
    const FString& FieldName,
    bool& OutBool
)

Get the field named FieldName as a string.

Public function Const

bool

 

TryGetEnumArrayField

(
    const FString& FieldName,
    TArray< TEnum >& OutArray
)

Get the field named FieldName as an array of enums.

Public function Const

TSharedPtr< FJsonValue >

 

TryGetField

(
    const FString& FieldName
)

Attempts to get the field with the specified name.

Public function Const

bool

 

TryGetNumberField

(
    const FString& FieldName,
    double& OutNumber
)

Get the field named FieldName as a number.

Public function Const

bool

 

TryGetNumberField

(
    const FString& FieldName,
    int32& OutNumber
)

Get the field named FieldName as a number, and makes sure it's within int32 range.

Public function Const

bool

 

TryGetNumberField

(
    const FString& FieldName,
    uint32& OutNumber
)

Get the field named FieldName as a number, and makes sure it's within uint32 range.

Public function Const

bool

 

TryGetNumberField

(
    const FString& FieldName,
    int64& OutNumber
)

Get the field named FieldName as a number.

Public function Const

bool

 

TryGetObjectField

(
    const FString& FieldName,
    const TSharedPtr< FJsonObject >*& OutObject
)

Try to get the field named FieldName as an object, or return false if it's another type

Public function Const

bool

 

TryGetStringArrayField

(
    const FString& FieldName,
    TArray< FString >& OutArray
)

Get the field named FieldName as an array of strings.

Public function Const

bool

 

TryGetStringField

(
    const FString& FieldName,
    FString& OutString
)

Get the field named FieldName as a string.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback