Skip to main content
Version: 2.x

UOdinJsonValue

Blueprintable FJsonValue wrapper

Declaration
UCLASS(BlueprintType, Blueprintable, ClassGroup = Odin)
class ODIN_API UOdinJsonValue : public UObject
  • Header: #include "OdinJsonValue.h"
  • Module: Odin
  • Inherits from: UObject
  • Blueprint: Blueprint type, Blueprintable · Blueprint reference

Overview​

Functions​

NameDescription
ConstructJsonValueNumberCreates a JSON value that holds a number.
ConstructJsonValueStringCreates a JSON value that holds a string.
ConstructJsonValueBoolCreates a JSON value that holds a boolean.
ConstructJsonValueArrayCreates a JSON value that holds an array of JSON values.
ConstructJsonValueObjectCreates a JSON value that holds a JSON object.
ConstructJsonValue
GetRootValue
SetRootValue
GetTypeReturns the type of the value.
GetTypeStringReturns the type of the value as a string.
IsNullReturns true if the value is null.
AsNumberReturns the value as a number.
AsStringReturns the value as a string.
AsBoolReturns the value as a boolean.
AsArrayReturns the value as an array of JSON values.
AsObjectReturns the value as a JSON object.

Functions​

ConstructJsonValueNumber​

Static · Blueprint: Construct Json Number Value

Creates a JSON value that holds a number.

UFUNCTION(BlueprintCallable, Category = "Odin|Json Utilities")
static UOdinJsonValue* ConstructJsonValueNumber(UObject* WorldContextObject, float Number);
ParameterTypeDescription
WorldContextObjectUObject*
Numberfloat

Returns UOdinJsonValue*

ConstructJsonValueString​

Static · Blueprint: Construct Json String Value

Creates a JSON value that holds a string.

UFUNCTION(BlueprintCallable, Category = "Odin|Json Utilities")
static UOdinJsonValue* ConstructJsonValueString(UObject* WorldContextObject, const FString& StringValue);
ParameterTypeDescription
WorldContextObjectUObject*
StringValueconst FString&

Returns UOdinJsonValue*

ConstructJsonValueBool​

Static · Blueprint: Construct Json Bool Value

Creates a JSON value that holds a boolean.

UFUNCTION(BlueprintCallable, Category = "Odin|Json Utilities")
static UOdinJsonValue* ConstructJsonValueBool(UObject* WorldContextObject, bool InValue);
ParameterTypeDescription
WorldContextObjectUObject*
InValuebool

Returns UOdinJsonValue*

ConstructJsonValueArray​

Static · Blueprint: Construct Json Array Value

Creates a JSON value that holds an array of JSON values.

UFUNCTION(BlueprintCallable, Category = "Odin|Json Utilities")
static UOdinJsonValue* ConstructJsonValueArray(
UObject* WorldContextObject,
const TArray<UOdinJsonValue* >& InArray);
ParameterTypeDescription
WorldContextObjectUObject*
InArrayconst TArray<UOdinJsonValue*>&

Returns UOdinJsonValue*

ConstructJsonValueObject​

Static · Blueprint: Construct Json Object Value

Creates a JSON value that holds a JSON object.

UFUNCTION(BlueprintCallable, Category = "Odin|Json Utilities")
static UOdinJsonValue* ConstructJsonValueObject(UObject* WorldContextObject, UOdinJsonObject* JsonObject);
ParameterTypeDescription
WorldContextObjectUObject*
JsonObjectUOdinJsonObject*

Returns UOdinJsonValue*

ConstructJsonValue​

Static

static UOdinJsonValue* ConstructJsonValue(UObject* WorldContextObject, const TSharedPtr<FJsonValue>& InValue);
ParameterTypeDescription
WorldContextObjectUObject*
InValueconst TSharedPtr<FJsonValue>&

Returns UOdinJsonValue*

GetRootValue​

TSharedPtr<FJsonValue>& GetRootValue();

Returns TSharedPtr<FJsonValue>&

SetRootValue​

void SetRootValue(TSharedPtr<FJsonValue>& JsonValue);
ParameterTypeDescription
JsonValueTSharedPtr<FJsonValue>&

GetType​

Const · Blueprint: Get Type

Returns the type of the value.

UFUNCTION(BlueprintPure, Category = "Odin|Json Utilities")
EOJson::Type GetType() const;

Returns EOJson::Type

GetTypeString​

Const · Blueprint: Get Type String

Returns the type of the value as a string.

UFUNCTION(BlueprintPure, Category = "Odin|Json Utilities")
FString GetTypeString() const;

Returns FString

IsNull​

Const · Blueprint: Is Null

Returns true if the value is null.

UFUNCTION(BlueprintPure, Category = "Odin|Json Utilities")
bool IsNull() const;

Returns bool

AsNumber​

Const · Blueprint: As Number

Returns the value as a number.

UFUNCTION(BlueprintPure, Category = "Odin|Json Utilities")
float AsNumber() const;

Returns float

AsString​

Const · Blueprint: As String

Returns the value as a string.

UFUNCTION(BlueprintPure, Category = "Odin|Json Utilities")
FString AsString() const;

Returns FString

AsBool​

Const · Blueprint: As Bool

Returns the value as a boolean.

UFUNCTION(BlueprintPure, Category = "Odin|Json Utilities")
bool AsBool() const;

Returns bool

AsArray​

Const · Blueprint: As Array

Returns the value as an array of JSON values.

UFUNCTION(BlueprintPure, Category = "Odin|Json Utilities")
TArray<UOdinJsonValue*> AsArray() const;

Returns TArray<UOdinJsonValue*>

AsObject​

Const · Blueprint: As Object

Returns the value as a JSON object.

UFUNCTION(BlueprintPure, Category = "Odin|Json Utilities")
UOdinJsonObject* AsObject() const;

Returns UOdinJsonObject*