FFastXml::ParseXmlFile

Quickly parse an XML file.

Windows
MacOS
Linux

References

Module

XmlParser

Header

/Engine/Source/Runtime/XmlParser/Public/FastXml.h

Include

#include "FastXml.h"

Source

/Engine/Source/Runtime/XmlParser/Private/FastXml.cpp

Syntax

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

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.

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.)

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.

Parameters

Parameter

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.

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

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss