A Demo Project for the UnrealEngineSDK
|
#include <DlgConfigWriter.h>
Public Member Functions | |
FDlgConfigWriter (const FString InComplexNamePrefix="", bool bInDontWriteEmptyContainer=true) | |
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 *Object) override |
Static Public Member Functions | |
static bool | CanSkipProperty (const FNYProperty *Property) |
static bool | CanWriteIndex (const FNYProperty *Property) |
static bool | CanWriteOneLinePerItem (const FNYProperty *Property) |
Protected Member Functions | |
const UStruct * | GetComplexType (const FNYProperty *Property) |
FString | GetNameWithoutPrefix (const FNYProperty *StructDefinition, const UObject *ObjectPtr=nullptr) |
FString | GetStringWithoutPrefix (const FString &String) |
bool | IsContainer (const FNYProperty *Property) |
bool | IsPrimitive (const FNYProperty *Property) |
bool | IsPrimitiveContainer (const FNYProperty *Property) |
bool | WouldWriteNonPrimitive (const UStruct *StructDefinition, const void *Owner) |
bool | WriteComplexArrayToString (const FNYProperty *Property, const void *Object, const FString &PreString, const FString &PostString, FString &Target) |
bool | WriteComplexElementToString (const FNYProperty *Property, const void *Object, bool bContainerElement, const FString &PreString, const FString &PostString, bool bPointerAsRef, FString &Target) |
void | WriteComplexMembersToString (const UStruct *StructDefinition, const void *Object, const FString &PreString, const FString &PostString, FString &Target) |
void | WriteComplexToString (const UStruct *StructDefinition, const FNYProperty *Property, const void *Object, const FString &PreString, const FString &PostString, bool bContainerElement, bool bWriteType, FString &Target) |
bool | WriteMapToString (const FNYProperty *Property, const void *Object, const FString &PreString, const FString &PostString, FString &Target) |
bool | WritePrimitiveArrayToString (const FNYProperty *Property, const void *Object, const FString &PreString, const FString &PostString, FString &Target) |
template<typename PropertyType , typename VariableType > | |
bool | WritePrimitiveArrayToStringTemplated (const FNYArrayProperty *ArrayProp, const void *Object, std::function< FString(const VariableType &)> ToString, const FString &PreString, const FString &PostString, FString &Target) |
bool | WritePrimitiveElementToString (const FNYProperty *Property, const void *Object, bool bContainerElement, const FString &PreString, const FString &PostString, FString &Target) |
template<typename PropertyType , typename VariableType > | |
bool | WritePrimitiveElementToStringTemplated (const FNYProperty *Property, const void *Object, bool bContainerElement, std::function< FString(const VariableType &)> GetAsString, const FString &PreString, const FString &PostString, FString &Target) |
template<typename PropertyType , typename VariableType > | |
bool | WritePrimitiveToStringTemplated (const FNYProperty *Property, const void *Object, bool bContainerElement, std::function< FString(const VariableType &)> GetAsString, const FString &PreString, const FString &PostString, FString &Target) |
bool | WritePropertyToString (const FNYProperty *Property, const void *Object, bool bContainerElement, const FString &PreString, const FString &PostString, bool bPointerAsRef, FString &Target) |
bool | WriteSetToString (const FNYProperty *Property, const void *Object, const FString &PreString, const FString &PostString, FString &Target) |
Static Protected Member Functions | |
static FString | NormalizeEndlines (const FString &Original) |
Protected Attributes | |
bool | bLogVerbose = false |
Static Protected Attributes | |
static constexpr int64 | SkipFlags = CPF_Deprecated | CPF_Transient |
Private Attributes | |
const bool | bDontWriteEmptyContainer |
const std::function< FString(const bool &) | BoolToString ) |
const FString | ComplexNamePrefix |
FString | ConfigText = "" |
const std::function< FString(const float &) | FloatToString ) |
const std::function< FString(const int64 &) | IntToString ) |
const std::function< FString(const FName &) | NameToString ) |
const std::function< FString(const FString &) | StringToString ) |
const std::function< FString(const FText &) | TextToString ) |
const void * | TopLevelObjectPtr = nullptr |
Static Private Attributes | |
static const TCHAR * | EOL = EOL_LF |
static const TCHAR * | EOL_CRLF = TEXT("\r\n") |
static const TCHAR * | EOL_LF = TEXT("\n") |
static const FString | EOL_String {EOL} |
Because there is always another config format And there is always a copy-pasted comment. See IDlgWriter for properties and METADATA specifiers.
Definition at line 22 of file DlgConfigWriter.h.
FDlgConfigWriter::FDlgConfigWriter | ( | const FString | InComplexNamePrefix = "", |
bool | bInDontWriteEmptyContainer = true ) |
Creates a config string from the input struct/object All property is saved recursively except the ones with the metadata "DlgNoExport" and the nodes with the flags defined in SkipFlags. Call ExportToFile() to save it
Check FDlgConfigParser for the list of supported constructions (some container is limited in some ways) If there is a nullptr in the middle of an array it is skipped, the array num will be different after parsing it back, unless it is written by reference
StructDefinition | UStruct of Object |
Object | pointer to a variable (Struct / UObject) |
InComplexNamePrefix | project specific pretag in struct and class names can be used not to export it to have better readable config file |
bInDontWriteEmptyContainer | if it is enabled empty TSet, TMap and TArray properties won't be written |
Definition at line 19 of file DlgConfigWriter.cpp.
|
inlinevirtualinherited |
Decides if the path to the object should be serialized, or the object itself
Definition at line 83 of file IDlgWriter.h.
|
inlinestaticinherited |
Can we skip this property from exporting?
Definition at line 41 of file IDlgWriter.h.
|
inlinestaticinherited |
Should write the index number for Property?
Definition at line 73 of file IDlgWriter.h.
|
inlinestaticinherited |
Should write one item per line for Property?
Definition at line 63 of file IDlgWriter.h.
|
inlineoverridevirtual |
Save the config string to a text file
FullName | Full path + file name + extension |
Implements IDlgWriter.
Definition at line 55 of file DlgConfigWriter.h.
|
inlineoverridevirtual |
Implements IDlgWriter.
Definition at line 60 of file DlgConfigWriter.h.
|
protected |
|
protected |
Definition at line 717 of file DlgConfigWriter.cpp.
|
protected |
|
protected |
|
inlineinherited |
Definition at line 108 of file IDlgWriter.h.
|
protected |
|
protected |
Definition at line 606 of file DlgConfigWriter.cpp.
|
inlinestaticprotected |
Converts all endlines to be of one type.
Definition at line 248 of file DlgConfigWriter.h.
|
inlineinherited |
Definition at line 109 of file IDlgWriter.h.
|
protected |
Definition at line 648 of file DlgConfigWriter.cpp.
|
overridevirtual |
Has to be called to prepare the text data
Implements IDlgWriter.
Definition at line 27 of file DlgConfigWriter.cpp.
|
protected |
Definition at line 393 of file DlgConfigWriter.cpp.
|
protected |
Definition at line 260 of file DlgConfigWriter.cpp.
|
protected |
Definition at line 34 of file DlgConfigWriter.cpp.
|
protected |
Definition at line 339 of file DlgConfigWriter.cpp.
|
protected |
Definition at line 453 of file DlgConfigWriter.cpp.
|
protected |
|
inlineprotected |
|
protected |
|
inlineprotected |
|
inlineprotected |
|
protected |
Definition at line 107 of file DlgConfigWriter.cpp.
|
protected |
Definition at line 517 of file DlgConfigWriter.cpp.
|
private |
Definition at line 266 of file DlgConfigWriter.h.
|
protectedinherited |
Definition at line 116 of file IDlgWriter.h.
|
private |
Definition at line 269 of file DlgConfigWriter.h.
|
private |
Definition at line 265 of file DlgConfigWriter.h.
|
private |
Definition at line 262 of file DlgConfigWriter.h.
|
staticprivate |
Definition at line 257 of file DlgConfigWriter.h.
|
staticprivate |
Definition at line 256 of file DlgConfigWriter.h.
|
staticprivate |
Definition at line 255 of file DlgConfigWriter.h.
|
staticprivate |
Definition at line 15 of file DlgConfigWriter.h.
|
private |
Definition at line 279 of file DlgConfigWriter.h.
|
private |
Definition at line 274 of file DlgConfigWriter.h.
|
private |
Definition at line 289 of file DlgConfigWriter.h.
|
staticconstexprprotectedinherited |
The properties with these flags set will be ignored from writing.
Definition at line 113 of file IDlgWriter.h.
|
private |
Definition at line 284 of file DlgConfigWriter.h.
|
private |
Definition at line 294 of file DlgConfigWriter.h.
|
private |
Definition at line 264 of file DlgConfigWriter.h.