Navigation
Unreal Engine C++ API Reference > Runtime > XmlParser > FFastXml
References
Module | XmlParser |
Header | /Engine/Source/Runtime/XmlParser/Public/FastXml.h |
Include | #include "FastXml.h" |
Source | /Engine/Source/Runtime/XmlParser/Private/FastXml.cpp |
static bool ParseXmlFile
&40;
class IFastXmlCallback &42; Callback,
const TCHAR &42; XmlFilePath,
TCHAR &42; XmlFileContents,
class FFeedbackContext &42; FeedbackContext,
const bool bShowSlowTaskDialog,
const bool bShowCancelButton,
FText & OutErrorMessage,
int32 & OutErrorLineNumber
&41;
Remarks
Quickly parse an XML file. Pass in your implementation of the IFastXmlCallback interface with code to handle parsed elements and attributes, along with either the full path to the XML file to load, or a string with the full XML file content. Returns true if loading was successful, or false if anything went wrong or the user canceled. When false is returned, an error message string will be set in the OutErrorMessage variable, along with the line number that parsing failed at in OutErrorLineNumber.
Parameters
Name | Description |
---|---|
Callback | As the parser encounters XML elements or attributes, methods on this callback object will be called |
XmlFilePath | The path on disk to the XML file to load, or an empty string if you'll be passing the XML file content in directly using the XmlFileContents parameter. |
XmlFileContents | The full contents of the file to parse, or an empty string if you've passed a full path to the file to parse using the XmlFilePath parameter. Note that this string will be modified during the parsing process, so make a copy of it first if you need it for something else (uncommon.) |
FeedbackContext | Optional feedback context for reporting warnings or progress (GWarn is typically passed in.) You can pass nullptr if you don't want any progress reported. |
bShowSlowTaskDialog | True if we should display a 'please wait' dialog while we parse the file, if the feedback context supports that |
bShowCancelButton | Whether the user is allowed to cancel the load of this XML file while in progress. If the user cancels loading, an appropriate error message will be returned. Only applies when bShowSlowTaskDialog is also enabled, and for feedback contexts that support cancel buttons. |
OutErrorMessage | If anything went wrong or the user canceled the load, this error will contain a description of the problem |
OutErrorLineNumber | Line number that any error happened on |