Commit Graph

2 Commits

Author SHA1 Message Date
Mike Fricker
2afcef78aa Fixed CIS error on mac with FastXml
[CL 2535895 by Mike Fricker in Main branch]
2015-05-04 12:14:44 -04:00
Mike Fricker
29e46a1bad Fast Xml parser for UE4
This is a simple XML parser that can load XML files very quickly.  The new FFastXml 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.

To process the XML data, create your own class that implements the IFastXmlCallback interface.  This class will be responsible for processing the XML elements as they are loaded by FFastXml::ParseXmlFile().  You'll receive a ProcessElement() call for every XML element that is encountered, along with a corresponding ProcessClose() when that element's scope has ended.  ProcessAttribute() will be called for any attributes found within the scope of the current element.

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

This XML parser based on John W. Ratcliff's "FastXml". (FastXml.tps included, with more info.)

[CL 2535797 by Mike Fricker in Main branch]
2015-05-04 11:00:39 -04:00