XLE  v0.02.0
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
Utility::XmlInputStreamFormatter< CharType > Class Template Reference

Deserializes element and attribute data from xml More...

#include <XmlStreamFormatter.h>

Classes

class  Scope
 

Public Types

enum  Blob {
  BeginElement, EndElement, AttributeName, AttributeValue,
  CharacterData, None
}
 
using InteriorSection = StringSection< CharType >
 
using value_type = CharType
 

Public Member Functions

Blob PeekNext (bool allowCharacterData=false)
 
bool TryBeginElement (InteriorSection &name)
 
bool TryEndElement ()
 
bool TryAttribute (InteriorSection &name, InteriorSection &value)
 
bool TryCharacterData (InteriorSection &cdata)
 
void SkipElement ()
 
StreamLocation GetLocation () const
 
 XmlInputStreamFormatter (const TextStreamMarker< CharType > &marker)
 

Protected Attributes

TextStreamMarker< CharType > _marker
 
Blob _primed
 
bool _pendingHeader
 
std::stack< Scope_scopeStack
 

Detailed Description

template<typename CharType>
class Utility::XmlInputStreamFormatter< CharType >

Deserializes element and attribute data from xml

This is an input deserializer for xml data that handles just element and attributes. The interface is compatible with InputStreamFormatter, and can be used as a drop-in replacement when required.

It's a hand-written perform oriented parser. It should perform reasonable well even for large files.

Note that this is a subset of true xml. Many XML features (like processing instructions, references and character data) aren't fully supported. But it will read elements and attributes – handy for applications of XML that use only these things. There is some support for reading character data. But it is limited and intended for simple tasks.


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