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

#include <FastXml.h>

Static Public Member Functions

static XMLPARSER_API bool ParseXmlFile (class IFastXmlCallback *Callback, const TCHAR *XmlFilePath, TCHAR *XmlFileContents, class FFeedbackContext *FeedbackContext, const bool bShowSlowTaskDialog, const bool bShowCancelButton, FText &OutErrorMessage, int32 &OutErrorLineNumber)
 

Detailed Description

Fast XML parser based on John W. Ratcliff's "FastXml" (see FastXml.tps and http://codesuppository.blogspot.com/2009/02/fastxml-extremely-lightweight-stream.html)

This is a simple XML parser that can load XML files very quickly. The class has a single static method, ParseXmlFile() for loading XML files. The parser is designed to load files efficiently, but may not support all XML features or be resilient to malformed data. Unlike the FXmlFile class, FFastXml does not generate an XML node tree. Instead, you must supply a callback class using IFastXmlCallback and respond to elements and attributes as they are parsed. Call the ParseXmlFile() function and pass in either the full path to the XML file to parse (XmlFilePath parameter), or load the file yourself and pass the contents using the XmlFileContents parameter. One of either XmlFilePath or XmlFileContents must be valid for ParseXmlFile() to work.

Remember to add a module dependency on "XmlParser" in order to be able to call FFastXml::ParserXmlFile().

Member Function Documentation

◆ ParseXmlFile()

bool FFastXml::ParseXmlFile ( class IFastXmlCallback Callback,
const TCHAR XmlFilePath,
TCHAR XmlFileContents,
class FFeedbackContext FeedbackContext,
const bool  bShowSlowTaskDialog,
const bool  bShowCancelButton,
FText OutErrorMessage,
int32 OutErrorLineNumber 
)
static

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.

Parameters
CallbackAs the parser encounters XML elements or attributes, methods on this callback object will be called
XmlFilePathThe 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.
XmlFileContentsThe 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.)
FeedbackContextOptional feedback context for reporting warnings or progress (GWarn is typically passed in.) You can pass nullptr if you don't want any progress reported.
bShowSlowTaskDialogTrue if we should display a 'please wait' dialog while we parse the file, if the feedback context supports that
bShowCancelButtonWhether 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.
OutErrorMessageIf anything went wrong or the user canceled the load, this error will contain a description of the problem
OutErrorLineNumberLine number that any error happened on
Returns
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.

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