XMLParser.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005 Palmsource, Inc.
00003  * 
00004  * This software is licensed as described in the file LICENSE, which
00005  * you should have received as part of this distribution. The terms
00006  * are also available at http://www.openbinder.org/license.html.
00007  * 
00008  * This software consists of voluntary contributions made by many
00009  * individuals. For the exact contribution history, see the revision
00010  * history and logs, available at http://www.openbinder.org
00011  */
00012 
00013 #ifndef _XML2_XMLPARSER_H
00014 #define _XML2_XMLPARSER_H
00015 
00016 #include <xml/IXMLOStr.h>
00017 #include <xml/Parser.h>
00018 
00019 #if _SUPPORTS_NAMESPACE
00020 namespace palmos {
00021 namespace xml {
00022 using namespace support;
00023 #endif
00024 
00025 /**************************************************************************************/
00026 
00027 class BXMLParser : public BXMLParseContext
00028 {
00029     public:
00030 
00031                                 BXMLParser(const sptr<IXMLOStr>& stream);
00032         virtual                 ~BXMLParser();
00033     
00034         virtual status_t        OnDocumentBegin(uint32_t flags);
00035         virtual status_t        OnDocumentEnd();
00036         virtual status_t        OnDocumentFail();
00037     
00038         virtual status_t        OnStartTag(SString &name, SValue &attributes);
00039         virtual status_t        OnEndTag(SString &name);
00040         virtual status_t        OnTextData(const char *data, int32_t size);
00041         virtual status_t        OnCData(const char *data, int32_t size);
00042     
00043         virtual status_t        OnGeneralParsedEntityRef(SString &name);
00044         virtual status_t        OnGeneralParsedEntityRef(SString &name, SString &replacement);
00045     
00046     private:
00047     
00048         sptr<IXMLOStr>          m_stream;
00049 };
00050 
00051 /**************************************************************************************/
00052 
00053 #if _SUPPORTS_NAMESPACE
00054 } } // namespace palmos::xml
00055 #endif
00056 
00057 #endif // _B_XML2_PARSER_H