• Main Page
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

ucommon/xml.h

Go to the documentation of this file.
00001 // Copyright (C) 2006-2010 David Sugar, Tycho Softworks.
00002 //
00003 // This file is part of GNU uCommon C++.
00004 //
00005 // GNU uCommon C++ is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU Lesser General Public License as published 
00007 // by the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // GNU uCommon C++ is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with GNU uCommon C++.  If not, see <http://www.gnu.org/licenses/>.
00017 
00023 #ifndef _UCOMMON_STRING_H_
00024 #include <ucommon/string.h>
00025 #endif
00026 
00027 #ifndef _UCOMMON_XML_H_
00028 #define _UCOMMON_XML_H_
00029 
00030 NAMESPACE_UCOMMON
00031 
00043 class __EXPORT XMLParser
00044 {
00045 private:
00046     int ecount, dcount;
00047     enum {TAG, CDATA, COMMENT, DTD, AMP, NONE} state;
00048     char *buffer;
00049     unsigned bufpos, bufsize;
00050     __LOCAL bool parseTag(void);
00051     __LOCAL void putBuffer(char c);
00052     __LOCAL void clearBuffer(void);
00053 
00054 protected:
00059     XMLParser(unsigned size = 8192);
00060 
00064     virtual ~XMLParser();
00065 
00071     virtual void comment(caddr_t text, size_t size);
00072 
00078     virtual void characters(caddr_t text, size_t size);
00079 
00083     virtual void startDocument(void);
00084 
00088     virtual void endDocument(void);
00089 
00095     virtual void startElement(caddr_t name, caddr_t *attr) = 0;
00096 
00101     virtual void endElement(caddr_t name) = 0;
00102 
00112     bool parse(const char *address, size_t size);
00113 };
00114         
00115 END_NAMESPACE
00116 
00117 #endif

Generated on Sun Sep 4 2011 for UCommon by  doxygen 1.7.1