A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
FDlgJsonWriter Class Reference

The DlgJsonWriter class mostly adapted for Dialogues, copied from FJsonObjectConverter See IDlgWriter for properties and METADATA specifiers. More...

#include <DlgJsonWriter.h>

Inheritance diagram for FDlgJsonWriter:
[legend]

Public Member Functions

 FDlgJsonWriter ()
 
virtual bool CanSaveAsReference (const FNYProperty *Property, const UObject *Object)
 
bool ExportToFile (const FString &FileName) override
 
const FString & GetAsString () const override
 
bool IsLogVerbose () const
 
void SetLogVerbose (bool bValue)
 
void Write (const UStruct *StructDefinition, const void *ContainerPtr) override
 

Static Public Member Functions

static bool CanSkipProperty (const FNYProperty *Property)
 
static bool CanWriteIndex (const FNYProperty *Property)
 
static bool CanWriteOneLinePerItem (const FNYProperty *Property)
 

Protected Attributes

bool bLogVerbose = false
 

Static Protected Attributes

static constexpr int64 SkipFlags = CPF_Deprecated | CPF_Transient
 

Private Member Functions

TSharedPtr< FJsonValue > ConvertScalarPropertyToJsonValue (const FNYProperty *Property, const void *const ContainerPtr, const void *const ValuePtr)
 
TSharedPtr< FJsonValue > PropertyToJsonValue (const FNYProperty *Property, const void *const ContainerPtr, const void *const ValuePtr)
 
void ResetState ()
 
bool UStructToJsonAttributes (const UStruct *StructDefinition, const void *const ContainerPtr, TMap< FString, TSharedPtr< FJsonValue > > &OutJsonAttributes)
 
bool UStructToJsonObject (const UStruct *StructDefinition, const void *const ContainerPtr, TSharedRef< FJsonObject > &OutJsonObject)
 
bool UStructToJsonString (const UStruct *StructDefinition, const void *const ContainerPtr, const DlgJsonWriterOptions &Options, FString &OutJsonString)
 

Private Attributes

bool bIsPropertyMapKey = false
 
int32 IndexInArray = INDEX_NONE
 
FString JsonString
 

Static Private Attributes

static constexpr int64 CheckFlags = ~CPF_ParmFlags
 

Detailed Description

The DlgJsonWriter class mostly adapted for Dialogues, copied from FJsonObjectConverter See IDlgWriter for properties and METADATA specifiers.

Definition at line 25 of file DlgJsonWriter.h.

Constructor & Destructor Documentation

◆ FDlgJsonWriter()

FDlgJsonWriter::FDlgJsonWriter ( )
inline

Call Order and possible calls:

  • DlgJsonWriter
    • UStructToJsonString
      • UStructToJsonObject
        • UStructToJsonAttributes
          • PropertyToJsonValue
            • ConvertScalarPropertyToJsonValue
              • PropertyToJsonValue
              • UStructToJsonObject

Definition at line 40 of file DlgJsonWriter.h.

Member Function Documentation

◆ CanSaveAsReference()

virtual bool IDlgWriter::CanSaveAsReference ( const FNYProperty * Property,
const UObject * Object )
inlinevirtualinherited

Decides if the path to the object should be serialized, or the object itself

Definition at line 83 of file IDlgWriter.h.

Here is the caller graph for this function:

◆ CanSkipProperty()

static bool IDlgWriter::CanSkipProperty ( const FNYProperty * Property)
inlinestaticinherited

Can we skip this property from exporting?

Definition at line 41 of file IDlgWriter.h.

Here is the caller graph for this function:

◆ CanWriteIndex()

static bool IDlgWriter::CanWriteIndex ( const FNYProperty * Property)
inlinestaticinherited

Should write the index number for Property?

Definition at line 73 of file IDlgWriter.h.

Here is the caller graph for this function:

◆ CanWriteOneLinePerItem()

static bool IDlgWriter::CanWriteOneLinePerItem ( const FNYProperty * Property)
inlinestaticinherited

Should write one item per line for Property?

Definition at line 63 of file IDlgWriter.h.

Here is the caller graph for this function:

◆ ConvertScalarPropertyToJsonValue()

TSharedPtr< FJsonValue > FDlgJsonWriter::ConvertScalarPropertyToJsonValue ( const FNYProperty * Property,
const void *const ContainerPtr,
const void *const ValuePtr )
private

Convert property to JSON, assuming either the property is not an array or the value is an individual array element Used by PropertyToJsonValue

Definition at line 28 of file DlgJsonWriter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExportToFile()

bool FDlgJsonWriter::ExportToFile ( const FString & FileName)
inlineoverridevirtual

Save the config string to a text file

Parameters
FullNameFull path + file name + extension
Returns
False on failure to write

Implements IDlgWriter.

Definition at line 50 of file DlgJsonWriter.h.

Here is the caller graph for this function:

◆ GetAsString()

const FString & FDlgJsonWriter::GetAsString ( ) const
inlineoverridevirtual

Implements IDlgWriter.

Definition at line 55 of file DlgJsonWriter.h.

◆ IsLogVerbose()

bool IDlgWriter::IsLogVerbose ( ) const
inlineinherited

Definition at line 108 of file IDlgWriter.h.

◆ PropertyToJsonValue()

TSharedPtr< FJsonValue > FDlgJsonWriter::PropertyToJsonValue ( const FNYProperty * Property,
const void *const ContainerPtr,
const void *const ValuePtr )
private

Converts from a Property to a Json Value using exportText

Parameters
PropertyThe property to export
ValuePtrPointer to the value of the property
Returns
The constructed JsonValue from the property

Definition at line 347 of file DlgJsonWriter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetState()

void FDlgJsonWriter::ResetState ( )
inlineprivate

Definition at line 115 of file DlgJsonWriter.h.

Here is the caller graph for this function:

◆ SetLogVerbose()

void IDlgWriter::SetLogVerbose ( bool bValue)
inlineinherited

Definition at line 109 of file IDlgWriter.h.

◆ UStructToJsonAttributes()

bool FDlgJsonWriter::UStructToJsonAttributes ( const UStruct * StructDefinition,
const void *const ContainerPtr,
TMap< FString, TSharedPtr< FJsonValue > > & OutJsonAttributes )
private

Converts from a UStruct to a set of json attributes (possibly from within a JsonObject)

Parameters
StructDefinitionUStruct definition that is looked over for properties
ContainerPtrThe object the UStruct represents.
JsonAttributesMap of attributes to copy in to
Returns
False if any properties failed to write

Definition at line 411 of file DlgJsonWriter.cpp.

Here is the call graph for this function:

◆ UStructToJsonObject()

bool FDlgJsonWriter::UStructToJsonObject ( const UStruct * StructDefinition,
const void *const ContainerPtr,
TSharedRef< FJsonObject > & OutJsonObject )
inlineprivate

Converts from a UStruct to a JSON Object

Parameters
StructDefinitionUStruct definition that is looked over for properties
ContainerPtrThe object the UStruct represents.
OutJsonObjectJson Object to be filled in with data from the ustruct
Returns
False if faile to fill properties

Definition at line 98 of file DlgJsonWriter.h.

Here is the caller graph for this function:

◆ UStructToJsonString()

bool FDlgJsonWriter::UStructToJsonString ( const UStruct * StructDefinition,
const void *const ContainerPtr,
const DlgJsonWriterOptions & Options,
FString & OutJsonString )
private

Converts from a UStruct to a JSON string containing an object, using exportText

Parameters
StructDefinitionUStruct definition that is looked over for properties
ContainerPtrThe object the UStruct represents.
OutJsonStringJson Object to be filled in with data from the ustruct
Returns
False if failed to serialize to string

Definition at line 559 of file DlgJsonWriter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write()

void FDlgJsonWriter::Write ( const UStruct * StructDefinition,
const void * Object )
overridevirtual

Has to be called before ExportToFile in order to have something to write

Implements IDlgWriter.

Definition at line 19 of file DlgJsonWriter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bIsPropertyMapKey

bool FDlgJsonWriter::bIsPropertyMapKey = false
private

Definition at line 134 of file DlgJsonWriter.h.

◆ bLogVerbose

bool IDlgWriter::bLogVerbose = false
protectedinherited

Definition at line 116 of file IDlgWriter.h.

◆ CheckFlags

constexpr int64 FDlgJsonWriter::CheckFlags = ~CPF_ParmFlags
staticconstexprprivate

Only properties that have these flags will be written.

Definition at line 126 of file DlgJsonWriter.h.

◆ IndexInArray

int32 FDlgJsonWriter::IndexInArray = INDEX_NONE
private

Definition at line 131 of file DlgJsonWriter.h.

◆ JsonString

FString FDlgJsonWriter::JsonString
private

Definition at line 123 of file DlgJsonWriter.h.

◆ SkipFlags

constexpr int64 IDlgWriter::SkipFlags = CPF_Deprecated | CPF_Transient
staticconstexprprotectedinherited

The properties with these flags set will be ignored from writing.

Definition at line 113 of file IDlgWriter.h.


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