#include <faith/minixml.h>
Public Types | |
| NoClosingTag = 1 | |
| IncompleteEntity | |
| IllegalCharacter | |
| NoAttributeName | |
| Other = 1000 | |
| User = 5000 | |
| enum | Error { NoClosingTag = 1, IncompleteEntity, IllegalCharacter, NoAttributeName, Other = 1000, User = 5000 } |
Public Member Functions | |
| MiniXML () | |
| virtual | ~MiniXML () |
| bool | parse (const String &doc) |
| virtual bool | startElement (const String &name, const std::map< String, String > &attributes) |
| virtual bool | endElement (const String &name) |
| virtual bool | text (const String &text) |
| virtual Faith::String | resolveEntity (const String &entity) |
| virtual void | error (Error error, int offset, int line, int ch) |
MiniXML supports tags, attributes, and text.
inherit from it, call parse, and the "start" and "end" functions, as well as text() will be called as per the data.
If there are any errors in the document (and MiniXML is quite pedantic...), error() will be called, and processing will then be aborted.
defines a few possible errors
| Faith::MiniXML::MiniXML | ( | ) |
| virtual Faith::MiniXML::~MiniXML | ( | ) | [virtual] |
| virtual bool Faith::MiniXML::endElement | ( | const String & | name | ) | [inline, virtual] |
marks the end of an element (tag).
You should reimplement this.
| virtual void Faith::MiniXML::error | ( | Error | error, | |
| int | offset, | |||
| int | line, | |||
| int | ch | |||
| ) | [inline, virtual] |
called when an error was found, and processing is aborted.
| error | is the cause of the error. | |
| offset | what position in the input string the error was encountered | |
| line | is approximately what line it was encountered on (UNIMPLEMENTED!!!) | |
| ch | is approximately what character on the line it was encountered on. (UNIMPLEMENTED!!!) |
| bool Faith::MiniXML::parse | ( | const String & | doc | ) |
parse the given document
| virtual Faith::String Faith::MiniXML::resolveEntity | ( | const String & | entity | ) | [virtual] |
Resolves an entity, by default, it converts a few well known entities including: lt, gt, and amp. But this is not necessarily an all-inclusive list. You can reimplement this to add more entities.
entity is the name of the entity (excluding leading ampersand and ending semicolon.
| virtual bool Faith::MiniXML::startElement | ( | const String & | name, | |
| const std::map< String, String > & | attributes | |||
| ) | [inline, virtual] |
marks the beginning of an element (tag).
| virtual bool Faith::MiniXML::text | ( | const String & | text | ) | [inline, virtual] |
marks the presence of some text in the XML document. This may be called twice per single block of text without any tags, but usually not
You should reimplement this.
1.4.7