The DlgJsonParser class mostly adapted for Dialogues, copied from FJsonObjectConverter See IDlgParser for properties and METADATA specifiers.
More...
#include <DlgJsonParser.h>
|
bool | ConvertScalarJsonValueToProperty (const TSharedPtr< FJsonValue > &JsonValue, FNYProperty *Property, void *ContainerPtr, void *ValuePtr) |
|
bool | JsonAttributesToUStruct (const TMap< FString, TSharedPtr< FJsonValue > > &JsonAttributes, const UStruct *StructDefinition, void *ContainerPtr) |
|
bool | JsonObjectStringToUStruct (const UStruct *StructDefinition, void *ContainerPtr) |
|
bool | JsonObjectToUStruct (const TSharedRef< const FJsonObject > &JsonObject, const UStruct *StructDefinition, void *ContainerPtr) |
|
bool | JsonValueToProperty (const TSharedPtr< FJsonValue > &JsonValue, FNYProperty *Property, void *ContainerPtr, void *ValuePtr) |
|
|
static constexpr int64 | CheckFlags = ~CPF_ParmFlags |
|
The DlgJsonParser class mostly adapted for Dialogues, copied from FJsonObjectConverter See IDlgParser for properties and METADATA specifiers.
Definition at line 19 of file DlgJsonParser.h.
◆ FDlgJsonParser() [1/2]
FDlgJsonParser::FDlgJsonParser |
( |
| ) |
|
|
inline |
Call Order and possible calls:
- DlgJsonParser
- InitializeParser
- JsonObjectStringToUStruct
- JsonObjectToUStruct
- JsonAttributesToUStruct
- JsonValueToProperty
- ConvertScalarJsonValueToProperty
- JsonValueToProperty
- JsonObjectToUStruct
Definition at line 35 of file DlgJsonParser.h.
◆ FDlgJsonParser() [2/2]
FDlgJsonParser::FDlgJsonParser |
( |
const FString & | FilePath | ) |
|
|
inline |
◆ ConvertScalarJsonValueToProperty()
bool FDlgJsonParser::ConvertScalarJsonValueToProperty |
( |
const TSharedPtr< FJsonValue > & | JsonValue, |
|
|
FNYProperty * | Property, |
|
|
void * | ContainerPtr, |
|
|
void * | ValuePtr ) |
|
private |
Convert JSON to property, assuming either the property is not an array or the value is an individual array element Used by JsonValueToProperty
Definition at line 109 of file DlgJsonParser.cpp.
◆ CreateNewUObject()
static UObject * IDlgParser::CreateNewUObject |
( |
const UClass * | StructDefinition, |
|
|
UObject * | ObjectOuter ) |
|
inlinestaticprotectedinherited |
Default way to create new objects
Definition at line 70 of file IDlgParser.h.
◆ GetChildClassFromName()
const UClass * IDlgParser::GetChildClassFromName |
( |
const UClass * | ParentClass, |
|
|
const FString & | Name ) |
|
inlineprotectedinherited |
Searches the proper not abstract class
- Parameters
-
ParentClass | the class we are looking for has to inherit from this class |
Name | the name of the class we are looking for (without engine pretags, e.g. Actor for AActor) |
- Returns
- the class, or nullptr if it does not exist
Definition at line 45 of file IDlgParser.h.
◆ InitializeParser()
void FDlgJsonParser::InitializeParser |
( |
const FString & | FilePath | ) |
|
|
overridevirtual |
◆ InitializeParserFromString()
void FDlgJsonParser::InitializeParserFromString |
( |
const FString & | Text | ) |
|
|
overridevirtual |
◆ IsLogVerbose()
bool IDlgParser::IsLogVerbose |
( |
| ) |
const |
|
inlineinherited |
◆ IsValidFile()
bool FDlgJsonParser::IsValidFile |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ JsonAttributesToUStruct()
bool FDlgJsonParser::JsonAttributesToUStruct |
( |
const TMap< FString, TSharedPtr< FJsonValue > > & | JsonAttributes, |
|
|
const UStruct * | StructDefinition, |
|
|
void * | ContainerPtr ) |
|
private |
Converts a set of json attributes (possibly from within a JsonObject) to a UStruct, using importText
- Parameters
-
JsonAttributes | Json Object to copy data out of |
StructDefinition | UStruct definition that is looked over for properties |
ContainerPtr | The Pointer instance to copy in to |
- Returns
- False if any properties matched but failed to deserialize
Definition at line 726 of file DlgJsonParser.cpp.
◆ JsonObjectStringToUStruct()
bool FDlgJsonParser::JsonObjectStringToUStruct |
( |
const UStruct * | StructDefinition, |
|
|
void * | ContainerPtr ) |
|
private |
Converts from a json string containing an object to a UStruct
- Parameters
-
OutStruct | The UStruct instance to copy in to |
ContainerPtr | The Pointer instance to copy in to |
- Returns
- False if any properties matched but failed to deserialize
Definition at line 837 of file DlgJsonParser.cpp.
◆ JsonObjectToUStruct()
bool FDlgJsonParser::JsonObjectToUStruct |
( |
const TSharedRef< const FJsonObject > & | JsonObject, |
|
|
const UStruct * | StructDefinition, |
|
|
void * | ContainerPtr ) |
|
inlineprivate |
Converts from a Json Object to a UStruct, using importText
- Parameters
-
JsonObject | Json Object to copy data out of |
StructDefinition | UStruct definition that is looked over for properties |
ContainerPtr | The Pointer instance to copy in to |
- Returns
- False if any properties matched but failed to deserialize
Definition at line 89 of file DlgJsonParser.h.
◆ JsonValueToProperty()
bool FDlgJsonParser::JsonValueToProperty |
( |
const TSharedPtr< FJsonValue > & | JsonValue, |
|
|
FNYProperty * | Property, |
|
|
void * | ContainerPtr, |
|
|
void * | ValuePtr ) |
|
private |
Converts a single JsonValue to the corresponding Property (this may recurse if the property is a UStruct for instance).
- Parameters
-
JsonValue | The value to assign to this property |
Property | The Property definition of the property we're setting. |
ValuePtr | Pointer to the property instance to be modified. |
- Returns
- False if the property failed to serialize
Definition at line 649 of file DlgJsonParser.cpp.
◆ ReadAllProperty()
void FDlgJsonParser::ReadAllProperty |
( |
const UStruct * | ReferenceClass, |
|
|
void * | TargetObject, |
|
|
UObject * | DefaultObjectOuter = nullptr ) |
|
overridevirtual |
Reads all property from the config file.
- Parameters
-
ReferenceClass | UStruct (or UClass) of the TargetObject |
TargetObject | pointer to the object instance the function will modify based on the config values |
DefaultObjectOuter | Outer used for UObject construction if necessary |
Implements IDlgParser.
Definition at line 96 of file DlgJsonParser.cpp.
◆ SetLogVerbose()
void IDlgParser::SetLogVerbose |
( |
bool | bValue | ) |
|
|
inlineinherited |
◆ bIsValidFile
bool FDlgJsonParser::bIsValidFile = false |
|
private |
◆ bLogVerbose
bool IDlgParser::bLogVerbose = false |
|
protectedinherited |
◆ CheckFlags
constexpr int64 FDlgJsonParser::CheckFlags = ~CPF_ParmFlags |
|
staticconstexprprivate |
Only properties that have these flags will be read.
Definition at line 113 of file DlgJsonParser.h.
◆ DefaultObjectOuter
UObject* FDlgJsonParser::DefaultObjectOuter = nullptr |
|
private |
The default object outer used when creating new objects when using NewObject.
Definition at line 110 of file DlgJsonParser.h.
◆ FileName
FString FDlgJsonParser::FileName |
|
private |
◆ JsonString
FString FDlgJsonParser::JsonString |
|
private |
◆ StructCache
TArray<UClass*> IDlgParser::StructCache |
|
protectedinherited |
each time a class is read it also cached here, so next time when it has to be found based on name it can be found faster
Definition at line 78 of file IDlgParser.h.
The documentation for this class was generated from the following files:
- SDKDemo/Plugins/UnrealEngineSDK/VisualScripter/Source/DlgSystem/Public/IO/DlgJsonParser.h
- SDKDemo/Plugins/UnrealEngineSDK/VisualScripter/Source/DlgSystem/Private/IO/DlgJsonParser.cpp