UOdinJsonObject
- Header:
#include "OdinJsonObject.h" - Module:
Odin - Inherits from:
UObject - Blueprint: Blueprint type, Blueprintable · Blueprint reference
Overview
Functions
| Name | Description |
|---|---|
ConstructJsonObject | Creates an empty JSON object. |
ConstructJsonObjectFromString | Creates a JSON object by parsing a JSON string. |
ConstructJsonObjectFromBytes | Creates a JSON object by parsing UTF-8 encoded JSON bytes, e.g. |
Reset | Removes all fields of the object. |
GetRootObject | |
SetRootObject | |
EncodeJson | Serializes the object to a JSON string. |
EncodeJsonBytes | Serializes the object to UTF-8 encoded JSON bytes, e.g. |
DecodeJson | Decodes a JSON string. |
GetFieldNames | Returns the names of all fields of the object. |
HasField | Returns true if the object has a field with the given name. |
RemoveField | Removes the field with the given name. |
GetField | Returns the value of a field as a JSON value. |
SetField | Sets a field to a JSON value. |
SetFieldNull | Sets a field to null. |
GetArrayField | Returns the elements of an array field as JSON values. |
SetArrayField | Sets a field to an array of JSON values. |
MergeJsonObject | Copies all fields of another JSON object into this one. |
GetNumberField | Returns the value of a number field. |
SetNumberField | Sets a field to a number. |
GetStringField | Returns the value of a string field. |
SetStringField | Sets a field to a string. |
GetBoolField | Returns the value of a boolean field. |
SetBoolField | Sets a field to a boolean. |
GetObjectField | Returns the value of an object field as a JSON object. |
SetObjectField | Sets a field to a JSON object. |
GetNumberArrayField | Returns the elements of an array field as numbers. |
SetNumberArrayField | Sets a field to an array of numbers. |
GetStringArrayField | Returns the elements of an array field as strings. |
SetStringArrayField | Sets a field to an array of strings. |
GetBoolArrayField | Returns the elements of an array field as booleans. |
SetBoolArrayField | Sets a field to an array of booleans. |
GetObjectArrayField | Returns the elements of an array field as JSON objects. |
SetObjectArrayField | Sets a field to an array of JSON objects. |
Functions
ConstructJsonObject
Static · Blueprint: Construct Json Object
Creates an empty JSON object.
| Parameter | Type | Description |
|---|---|---|
WorldContextObject | UObject* |
Returns UOdinJsonObject*
ConstructJsonObjectFromString
Static · Blueprint: Construct Json Object From String
Creates a JSON object by parsing a JSON string.
| Parameter | Type | Description |
|---|---|---|
WorldContextObject | UObject* | |
Data | const FString& | The JSON string. |
Returns UOdinJsonObject*
ConstructJsonObjectFromBytes
Static · Blueprint: Construct Json Object From Bytes
Creates a JSON object by parsing UTF-8 encoded JSON bytes, e.g. the user data of a peer.
| Parameter | Type | Description |
|---|---|---|
WorldContextObject | UObject* | |
Data | const TArray<uint8>& | The JSON bytes. |
Returns UOdinJsonObject*
Reset
Blueprint: Reset
Removes all fields of the object.
GetRootObject
Returns TSharedPtr<FJsonObject>&
SetRootObject
| Parameter | Type | Description |
|---|---|---|
JsonObject | const TSharedPtr<FJsonObject>& |
EncodeJson
Const · Blueprint: Encode Json
Serializes the object to a JSON string.
Returns FString
EncodeJsonBytes
Const · Blueprint: Encode Json Bytes
Serializes the object to UTF-8 encoded JSON bytes, e.g. to use as peer user data.
Returns TArray<uint8>
DecodeJson
Blueprint: Decode Json
Decodes a JSON string. If the provided string is successfully parsed into a valid JSON object, it updates the internal structure of this object. If parsing fails, the internal state is reset to clear any existing data.
| Parameter | Type | Description |
|---|---|---|
JsonString | const FString& | The JSON formatted string to be decoded. |
Returns bool – true if the JSON string was successfully parsed and decoded, false if the decoding failed.
GetFieldNames
Const · Blueprint: Get Field Names
Returns the names of all fields of the object.
Returns TArray<FString>
HasField
Const · Blueprint: Has Field
Returns true if the object has a field with the given name.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns bool
RemoveField
Blueprint: Remove Field
Removes the field with the given name.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
GetField
Const · Blueprint: Get Field
Returns the value of a field as a JSON value.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns UOdinJsonValue*
SetField
Blueprint: Set Field
Sets a field to a JSON value.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
JsonValue | UOdinJsonValue* |
SetFieldNull
Blueprint: Set Field Null
Sets a field to null.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
GetArrayField
Const · Blueprint: Get Array Field
Returns the elements of an array field as JSON values.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns TArray<UOdinJsonValue*>
SetArrayField
Blueprint: Set Array Field
Sets a field to an array of JSON values.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
InArray | const TArray<UOdinJsonValue*>& |
MergeJsonObject
Blueprint: Merge Json Object
Copies all fields of another JSON object into this one.
| Parameter | Type | Description |
|---|---|---|
InJsonObject | UOdinJsonObject* | The object to copy the fields from. |
Overwrite | bool | Whether existing fields are replaced. |
GetNumberField
Const · Blueprint: Get Number Field
Returns the value of a number field.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns float
SetNumberField
Blueprint: Set Number Field
Sets a field to a number.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
Number | float |
GetStringField
Const · Blueprint: Get String Field
Returns the value of a string field.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns FString
SetStringField
Blueprint: Set String Field
Sets a field to a string.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
StringValue | const FString& |
GetBoolField
Const · Blueprint: Get Bool Field
Returns the value of a boolean field.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns bool
SetBoolField
Blueprint: Set Bool Field
Sets a field to a boolean.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
InValue | bool |
GetObjectField
Const · Blueprint: Get Object Field
Returns the value of an object field as a JSON object.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns UOdinJsonObject*
SetObjectField
Blueprint: Set Object Field
Sets a field to a JSON object.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
JsonObject | UOdinJsonObject* |
GetNumberArrayField
Blueprint: Get Number Array Field
Returns the elements of an array field as numbers.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns TArray<float>
SetNumberArrayField
Blueprint: Set Number Array Field
Sets a field to an array of numbers.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
NumberArray | const TArray<float>& |
GetStringArrayField
Blueprint: Get String Array Field
Returns the elements of an array field as strings.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns TArray<FString>
SetStringArrayField
Blueprint: Set String Array Field
Sets a field to an array of strings.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
StringArray | const TArray<FString>& |
GetBoolArrayField
Blueprint: Get Bool Array Field
Returns the elements of an array field as booleans.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns TArray<bool>
SetBoolArrayField
Blueprint: Set Bool Array Field
Sets a field to an array of booleans.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
BoolArray | const TArray<bool>& |
GetObjectArrayField
Const · Blueprint: Get Object Array Field
Returns the elements of an array field as JSON objects.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& |
Returns TArray<UOdinJsonObject*>
SetObjectArrayField
Blueprint: Set Object Array Field
Sets a field to an array of JSON objects.
| Parameter | Type | Description |
|---|---|---|
FieldName | const FString& | |
ObjectArray | const TArray<UOdinJsonObject*>& |