UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FXmlFile Class Reference

#include <XmlFile.h>

Public Member Functions

 FXmlFile ()
 
XMLPARSER_API FXmlFile (const FString &InFile, EConstructMethod::Type ConstructMethod=EConstructMethod::ConstructFromFile)
 
 ~FXmlFile ()
 
 FXmlFile (const FXmlFile &rhs)=delete
 
FXmlFileoperator= (const FXmlFile &rhs)=delete
 
XMLPARSER_API bool LoadFile (const FString &Path, EConstructMethod::Type ConstructMethod=EConstructMethod::ConstructFromFile)
 
XMLPARSER_API FString GetLastError () const
 
XMLPARSER_API void Clear ()
 
XMLPARSER_API bool IsValid () const
 
XMLPARSER_API const FXmlNodeGetRootNode () const
 
XMLPARSER_API FXmlNodeGetRootNode ()
 
XMLPARSER_API bool Save (const FString &Path)
 
XMLPARSER_API void EnableAttemptToPreserveWhitespaceHack ()
 

Detailed Description

Class representing an XML file

Constructor & Destructor Documentation

◆ FXmlFile() [1/3]

FXmlFile::FXmlFile ( )
inline

Constructs the file without a path

◆ FXmlFile() [2/3]

FXmlFile::FXmlFile ( const FString &  InFile,
EConstructMethod::Type  ConstructMethod = EConstructMethod::ConstructFromFile 
)

Constructs the file with the passed path. InFile is either treated as a filename to open, or as a text buffer to load.

Parameters
InFileThe path/text to use
ConstructMethodWhether to load a file of use the string as a buffer of xml data

◆ ~FXmlFile()

FXmlFile::~FXmlFile ( )
inline

◆ FXmlFile() [3/3]

FXmlFile::FXmlFile ( const FXmlFile rhs)
delete

Member Function Documentation

◆ Clear()

void FXmlFile::Clear ( )

Clears the file of all internals. Note: Makes any existing pointers to FXmlNode's INVALID

◆ EnableAttemptToPreserveWhitespaceHack()

void FXmlFile::EnableAttemptToPreserveWhitespaceHack ( )

Turns on a specific hack that is only used by the crash report client in order to retain newlines for callstacks. This is important on the server side when we display the callstacks to content creators. Without the content-whitespace, they're bascially illegible. Neither version of the DOM we create is technically true to the XML spec.

◆ GetLastError()

FString FXmlFile::GetLastError ( ) const

Gets the last error message from the class

◆ GetRootNode() [1/2]

FXmlNode * FXmlFile::GetRootNode ( )

Returns the root node of the loaded file. nullptr if no file loaded. It is assumed that there will always be one and only one root node.

Returns
Pointer to root node

◆ GetRootNode() [2/2]

const FXmlNode * FXmlFile::GetRootNode ( ) const

Returns the root node of the loaded file. nullptr if no file loaded. It is assumed that there will always be one and only one root node.

Returns
Pointer to root node

◆ IsValid()

bool FXmlFile::IsValid ( ) const

Checks to see if a file is loaded

◆ LoadFile()

bool FXmlFile::LoadFile ( const FString &  Path,
EConstructMethod::Type  ConstructMethod = EConstructMethod::ConstructFromFile 
)

Loads the file with the passed path. Path is either treated as a filename to open, or as a text buffer to load.

Parameters
PathThe path/text to use
ConstructMethodWhether to load a file of use the string as a buffer of xml data

◆ operator=()

FXmlFile & FXmlFile::operator= ( const FXmlFile rhs)
delete

◆ Save()

bool FXmlFile::Save ( const FString &  Path)

Write to disk, UTF-16 format only at the moment

Parameters
PathFile path to save to
Returns
Whether writing the XML to a file succeeded

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