00001 #ifndef KDE__MINIXML_H
00002 #define KDE__MINIXML_H
00003
00004 #include <faith/string.h>
00005
00006 #include <map>
00007
00008 namespace Faith
00009 {
00010
00011
00023 class FAITH_TOOLS_EXPORT MiniXML
00024 {
00025 public:
00026 MiniXML();
00027 virtual ~MiniXML();
00028
00034 bool parse(const String &doc);
00035
00045 virtual bool startElement(const String &name, const std::map<String, String> &attributes)
00046 {
00047 (void)name;
00048 (void)attributes;
00049 return true;
00050 }
00063 virtual bool endElement(const String &name) { (void)name; return true; }
00064
00071 virtual bool text(const String &text) { (void)text; return true; }
00072
00082 virtual Faith::String resolveEntity(const String &entity);
00083
00096 enum Error
00097 {
00098 NoClosingTag=1,
00099 IncompleteEntity,
00100 IllegalCharacter,
00101 NoAttributeName,
00102 Other=1000,
00103 User=5000
00104 };
00105
00106
00115 virtual void error(Error error, int offset, int line, int ch)
00116 {
00117 (void)error;
00118 (void)offset;
00119 (void)line;
00120 (void)ch;
00121 }
00122
00123 private:
00124 bool prepareText(Faith::String *string);
00125 };
00126
00127
00128 }
00129
00130
00131 #endif