UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FJsonValue Class Referenceabstract

#include <JsonValue.h>

+ Inheritance diagram for FJsonValue:

Public Member Functions

JSON_API double AsNumber () const
 
JSON_API FString AsString () const
 
JSON_API FUtf8String AsUtf8String () const
 
JSON_API bool AsBool () const
 
JSON_API const TArray< TSharedPtr< FJsonValue > > & AsArray () const
 
virtual JSON_API const TSharedPtr< FJsonObject > & AsObject () const
 
virtual JSON_API bool TryGetNumber (double &OutNumber) const
 
virtual JSON_API bool TryGetNumber (float &OutNumber) const
 
virtual JSON_API bool TryGetNumber (int8 &OutNumber) const
 
virtual JSON_API bool TryGetNumber (int16 &OutNumber) const
 
virtual JSON_API bool TryGetNumber (int32 &OutNumber) const
 
virtual JSON_API bool TryGetNumber (int64 &OutNumber) const
 
virtual JSON_API bool TryGetNumber (uint8 &OutNumber) const
 
virtual JSON_API bool TryGetNumber (uint16 &OutNumber) const
 
virtual JSON_API bool TryGetNumber (uint32 &OutNumber) const
 
virtual JSON_API bool TryGetNumber (uint64 &OutNumber) const
 
virtual JSON_API bool TryGetString (FString &OutString) const
 
virtual JSON_API bool TryGetUtf8String (FUtf8String &OutString) const
 
virtual JSON_API bool TryGetBool (bool &OutBool) const
 
virtual JSON_API bool TryGetArray (const TArray< TSharedPtr< FJsonValue > > *&OutArray) const
 
virtual JSON_API bool TryGetArray (TArray< TSharedPtr< FJsonValue > > *&OutArray)
 
virtual JSON_API bool TryGetObject (const TSharedPtr< FJsonObject > *&Object) const
 
virtual JSON_API bool TryGetObject (TSharedPtr< FJsonObject > *&Object)
 
virtual JSON_API bool PreferStringRepresentation () const
 
bool IsNull () const
 
void AsArgumentType (double &Value)
 
void AsArgumentType (FString &Value)
 
void AsArgumentType (bool &Value)
 
void AsArgumentType (TArray< TSharedPtr< FJsonValue > > &Value)
 
void AsArgumentType (TSharedPtr< FJsonObject > &Value)
 
virtual JSON_API SIZE_T GetMemoryFootprint () const
 

Static Public Member Functions

static JSON_API TSharedPtr< FJsonValueDuplicate (const TSharedPtr< const FJsonValue > &Src)
 
static JSON_API TSharedPtr< FJsonValueDuplicate (const TSharedPtr< FJsonValue > &Src)
 
static JSON_API bool CompareEqual (const FJsonValue &Lhs, const FJsonValue &Rhs)
 

Public Attributes

EJson Type
 

Protected Member Functions

JSON_API FJsonValue ()
 
virtual JSON_API ~FJsonValue ()
 
virtual FString GetType () const =0
 
JSON_API void ErrorMessage (const FString &InType) const
 

Friends

bool operator== (const FJsonValue &Lhs, const FJsonValue &Rhs)
 
bool operator!= (const FJsonValue &Lhs, const FJsonValue &Rhs)
 

Detailed Description

A Json Value is a structure that can be any of the Json Types. It should never be used on its, only its derived types should be used.

Constructor & Destructor Documentation

◆ FJsonValue()

FJsonValue::FJsonValue ( )
protected

◆ ~FJsonValue()

FJsonValue::~FJsonValue ( )
protectedvirtualdefault

Member Function Documentation

◆ AsArgumentType() [1/5]

void FJsonValue::AsArgumentType ( bool Value)
inline

◆ AsArgumentType() [2/5]

void FJsonValue::AsArgumentType ( double Value)
inline

Get a field of the same type as the argument

◆ AsArgumentType() [3/5]

void FJsonValue::AsArgumentType ( FString &  Value)
inline

◆ AsArgumentType() [4/5]

void FJsonValue::AsArgumentType ( TArray< TSharedPtr< FJsonValue > > &  Value)
inline

◆ AsArgumentType() [5/5]

void FJsonValue::AsArgumentType ( TSharedPtr< FJsonObject > &  Value)
inline

◆ AsArray()

const TArray< TSharedPtr< FJsonValue > > & FJsonValue::AsArray ( ) const

Returns this value as an array, logging an error and returning an empty array reference if not possible

◆ AsBool()

bool FJsonValue::AsBool ( ) const

Returns this value as a boolean, logging an error and returning false if not possible

◆ AsNumber()

double FJsonValue::AsNumber ( ) const

Returns this value as a double, logging an error and returning zero if this is not an Json Number

◆ AsObject()

const TSharedPtr< FJsonObject > & FJsonValue::AsObject ( ) const
virtual

Returns this value as an object, throwing an error if this is not an Json Object

◆ AsString()

FString FJsonValue::AsString ( ) const

Returns this value as a string, logging an error and returning an empty string if not possible

◆ AsUtf8String()

FUtf8String FJsonValue::AsUtf8String ( ) const

Returns this value as a utf8 string, logging an error and returning an empty string if not possible

◆ CompareEqual()

bool FJsonValue::CompareEqual ( const FJsonValue Lhs,
const FJsonValue Rhs 
)
static

◆ Duplicate() [1/2]

TSharedPtr< FJsonValue > FJsonValue::Duplicate ( const TSharedPtr< const FJsonValue > &  Src)
static

◆ Duplicate() [2/2]

TSharedPtr< FJsonValue > FJsonValue::Duplicate ( const TSharedPtr< FJsonValue > &  Src)
static

◆ ErrorMessage()

void FJsonValue::ErrorMessage ( const FString &  InType) const
protected

◆ GetMemoryFootprint()

SIZE_T FJsonValue::GetMemoryFootprint ( ) const
virtual

Returns the memory footprint for this object in Bytes, including sizeof(*this) and allocated memory. All children should implement this so their memory layout is properly accounted for

Reimplemented in TJsonValueString< CharType >, FJsonValueNumber, TJsonValueNumberString< CharType >, FJsonValueBoolean, FJsonValueArray, FJsonValueObject, and FJsonValueNull.

◆ GetType()

◆ IsNull()

bool FJsonValue::IsNull ( ) const
inline

Returns true if this value is a 'null'

◆ PreferStringRepresentation()

bool FJsonValue::PreferStringRepresentation ( ) const
virtual

Returns whether or not a caller should prefer a string representation of the value, rather than the natural JSON type

Reimplemented in TJsonValueNumberString< CharType >.

◆ TryGetArray() [1/2]

bool FJsonValue::TryGetArray ( const TArray< TSharedPtr< FJsonValue > > *&  OutArray) const
virtual

Tries to convert this value to an array, returning false if not possible

Reimplemented in FJsonValueArray.

◆ TryGetArray() [2/2]

bool FJsonValue::TryGetArray ( TArray< TSharedPtr< FJsonValue > > *&  OutArray)
virtual

Tries to convert this value to an array, returning false if not possible

Reimplemented in FJsonValueArray.

◆ TryGetBool()

bool FJsonValue::TryGetBool ( bool OutBool) const
virtual

Tries to convert this value to a bool, returning false if not possible

Reimplemented in TJsonValueString< CharType >, FJsonValueNumber, TJsonValueNumberString< CharType >, and FJsonValueBoolean.

◆ TryGetNumber() [1/10]

bool FJsonValue::TryGetNumber ( double OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueString< CharType >, TJsonValueNumberString< CharType >, FJsonValueNumber, and FJsonValueBoolean.

◆ TryGetNumber() [2/10]

bool FJsonValue::TryGetNumber ( float OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueNumberString< CharType >.

◆ TryGetNumber() [3/10]

bool FJsonValue::TryGetNumber ( int16 OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueNumberString< CharType >.

◆ TryGetNumber() [4/10]

bool FJsonValue::TryGetNumber ( int32 OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueString< CharType >, and TJsonValueNumberString< CharType >.

◆ TryGetNumber() [5/10]

bool FJsonValue::TryGetNumber ( int64 OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueString< CharType >, and TJsonValueNumberString< CharType >.

◆ TryGetNumber() [6/10]

bool FJsonValue::TryGetNumber ( int8 OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueNumberString< CharType >.

◆ TryGetNumber() [7/10]

bool FJsonValue::TryGetNumber ( uint16 OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueNumberString< CharType >.

◆ TryGetNumber() [8/10]

bool FJsonValue::TryGetNumber ( uint32 OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueString< CharType >, and TJsonValueNumberString< CharType >.

◆ TryGetNumber() [9/10]

bool FJsonValue::TryGetNumber ( uint64 OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueString< CharType >, and TJsonValueNumberString< CharType >.

◆ TryGetNumber() [10/10]

bool FJsonValue::TryGetNumber ( uint8 OutNumber) const
virtual

Tries to convert this value to a number, returning false if not possible

Reimplemented in TJsonValueNumberString< CharType >.

◆ TryGetObject() [1/2]

bool FJsonValue::TryGetObject ( const TSharedPtr< FJsonObject > *&  Object) const
virtual

Tries to convert this value to an object, returning false if not possible

Reimplemented in FJsonValueObject.

◆ TryGetObject() [2/2]

bool FJsonValue::TryGetObject ( TSharedPtr< FJsonObject > *&  Object)
virtual

Tries to convert this value to an object, returning false if not possible

Reimplemented in FJsonValueObject.

◆ TryGetString()

bool FJsonValue::TryGetString ( FString &  OutString) const
virtual

Tries to convert this value to a string, returning false if not possible

Reimplemented in TJsonValueString< CharType >, FJsonValueNumber, TJsonValueNumberString< CharType >, and FJsonValueBoolean.

◆ TryGetUtf8String()

bool FJsonValue::TryGetUtf8String ( FUtf8String OutString) const
virtual

Tries to convert this value to a utf8 string, returning false if not possible

Reimplemented in TJsonValueString< CharType >, FJsonValueNumber, TJsonValueNumberString< CharType >, and FJsonValueBoolean.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const FJsonValue Lhs,
const FJsonValue Rhs 
)
friend

◆ operator==

bool operator== ( const FJsonValue Lhs,
const FJsonValue Rhs 
)
friend

Member Data Documentation

◆ Type

EJson FJsonValue::Type

The documentation for this class was generated from the following files: