XMLParser.h

00001 //
00002 //  Copyright (c) 2003-2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED,
00008 //  AS TO THE CORRECTNESS OF THIS CODE OR ANY DERIVATIVE
00009 //  WORKS WHICH INCORPORATE IT.
00010 //
00011 //  AUTODESK PROVIDES THE CODE ON AN "AS-IS" BASIS
00012 //  AND EXPLICITLY DISCLAIMS ANY LIABILITY, INCLUDING
00013 //  CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00014 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00015 //
00016 //  Use, duplication, or disclosure by the U.S. Government is subject to
00017 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00018 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00019 //  Data and Computer Software), as applicable.
00020 //
00021 #ifndef _DWFCORE_XML_READER_H
00022 #define _DWFCORE_XML_READER_H
00023 
00028 
00029 #include "dwfcore/InputStream.h"
00030 #include "dwfcore/XML.h"
00031 #include "dwfcore/Pointer.h"
00032 #include "dwfcore/String.h"
00033 
00034 
00035 #if     defined(DWFCORE_SYSTEM_EXPAT) || defined(DWF_USE_SYSTEM_EXPAT)
00036 #include <expat.h>
00037 #else
00038 #include "dwfcore/expat/expat.h"
00039 #endif
00040 
00041 namespace DWFCore
00042 {
00043 
00049 class DWFXMLParser
00050 {
00051 
00052 public:
00053     
00062     _DWFCORE_API
00063         DWFXMLParser(DWFXMLCallback* pCallback) throw(DWFException);
00064 
00068     _DWFCORE_API
00069     virtual ~DWFXMLParser();
00070 
00074     _DWFCORE_API
00075     void initializeParser();
00076 
00081     _DWFCORE_API
00082     void releaseParser();
00083 
00089     _DWFCORE_API
00090     void stopParser() throw(DWFException);
00091 
00099     _DWFCORE_API
00100     bool isParsingFinished() { return _bIsParsingFinished; }
00101     
00114     _DWFCORE_API
00115     static void XMLCALL StartElementHandler( void*             pCallback,
00116                                              const char*       zName,
00117                                              const char**      ppAttributeList )
00118         throw();
00119 
00130     _DWFCORE_API
00131     static void XMLCALL EndElementHandler( void*               pCallback,
00132                                            const char*         zName )
00133         throw();
00134 
00146     _DWFCORE_API
00147     static void XMLCALL StartNamespaceDeclHandler( void*       pCallback,
00148                                                    const char* zPrefix,
00149                                                    const char* zURI )
00150         throw();
00151 
00162     _DWFCORE_API
00163     static void XMLCALL EndNamespaceDeclHandler( void*         pCallback,
00164                                                  const char*   zPrefix )
00165         throw();
00166 
00178     _DWFCORE_API
00179     static void XMLCALL CharacterDataHandler( void*        pCallback,
00180                                               const char*  zCData,
00181                                               int          nLength )
00182         throw();
00183 
00184 
00193     _DWFCORE_API
00194     virtual void parseDocument( DWFInputStream& rDocumentStream ) 
00195         throw( DWFException );
00196 
00197 private:
00198         DWFPointer<char>                   _apParseBuffer;
00199         XML_Parser                                 _pXMLParser;
00200     DWFXMLCallback*            _pCallBack;
00201         //Flags
00202     bool                           _bIsParsingFinished;
00203 };
00204 
00205 }
00206 
00207 #endif
00208 

Generated on Tue Jan 6 22:39:29 2009 for Autodesk DWF Core Library by  doxygen 1.4.5