| API Docs for SAX and DOM |
| Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages # SAX2XMLReader.hpp Go to the documentation of this file.
    00001 /*
    00002  * Copyright 1999-2001,2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *      http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016
    00017 /*
    00018  * $Id: SAX2XMLReader.hpp 191054 2005-06-17 02:56:35Z jberry $
    00019  */
    00020
    00021 #ifndef SAX2XMLReader_HPP
    00022 #define SAX2XMLReader_HPP
    00023
    00024 #include <xercesc/util/XercesDefs.hpp>
    00025 #include <xercesc/util/XMLUniDefs.hpp>
    00026 #include <xercesc/framework/XMLValidator.hpp>
    00027 #include <xercesc/framework/XMLPScanToken.hpp>
    00028
    00029 XERCES_CPP_NAMESPACE_BEGIN
    00030
    00031 class ContentHandler ;
    00032 class DTDHandler;
    00033 class EntityResolver;
    00034 class ErrorHandler;
    00035 class InputSource;
    00036 class LexicalHandler;
    00037 class DeclHandler;
    00038 class XMLDocumentHandler;
    00039 class Grammar;
    00040
    00041 class  SAX2XMLReader
    00042 {
    00043 public:
    00044     // -----------------------------------------------------------------------
    00045     //  Class types
    00046     // -----------------------------------------------------------------------
    00049
    00057     enum ValSchemes
    00058     {
    00059         Val_Never
    00060         , Val_Always
    00061         , Val_Auto
    00062     };
    00064
    00065
    00066     // -----------------------------------------------------------------------
    00067     //  Constructors and Destructor
    00068     // -----------------------------------------------------------------------
    00072     SAX2XMLReader()
    00073     {
    00074     }
    00076     virtual ~SAX2XMLReader()
    00077     {
    00078     }
    00080
    00081     //-----------------------------------------------------------------------
    00082     // The XMLReader interface
    00083     //-----------------------------------------------------------------------
    00086
    00092     virtual ContentHandler* getContentHandler() const = 0 ;
    00093
    00099     virtual DTDHandler* getDTDHandler() const = 0;
    00100
    00106     virtual EntityResolver* getEntityResolver() const = 0 ;
    00107
    00113     virtual ErrorHandler* getErrorHandler() const = 0 ;
    00114
    00122     virtual bool getFeature(const XMLCh* const name) const = 0;
    00123
    00143     virtual void* getProperty(const XMLCh* const name) const = 0 ;
    00144
    00161     virtual void setContentHandler(ContentHandler* const handler) = 0;
    00162
    00178     virtual void setDTDHandler(DTDHandler* const handler) = 0;
    00179
    00196     virtual void setEntityResolver(EntityResolver* const resolver) = 0;
    00197
    00215     virtual void setErrorHandler(ErrorHandler* const handler) = 0;
    00216
    00240     virtual void setFeature(const XMLCh* const name, const bool value) = 0;
    00241
    00265     virtual void setProperty(const XMLCh* const name, void* value) = 0 ;
    00266
    00292     virtual void parse
    00293     (
    00294         const   InputSource&    source
    00295     ) = 0;
    00296
    00316     virtual void parse
    00317     (
    00318         const   XMLCh* const    systemId
    00319     ) = 0;
    00320
    00340     virtual void parse
    00341     (
    00342         const   char* const     systemId
    00343     ) = 0;
    00344
    00346
    00347     // -----------------------------------------------------------------------
    00348     //  SAX 2.0-ext
    00349     // -----------------------------------------------------------------------
    00357     virtual DeclHandler* getDeclarationHandler() const = 0 ;
    00358
    00364     virtual LexicalHandler* getLexicalHandler() const = 0 ;
    00365
    00382     virtual void setDeclarationHandler(DeclHandler* const handler) = 0;
    00383
    00400     virtual void setLexicalHandler(LexicalHandler* const handler) = 0;
    00401
    00403
    00404     // -----------------------------------------------------------------------
    00405     //  Getter Methods
    00406     // -----------------------------------------------------------------------
    00419     virtual XMLValidator* getValidator() const = 0;
    00420
    00431     virtual int getErrorCount() const = 0 ;
    00432
    00446     virtual bool getExitOnFirstFatalError() const = 0;
    00447
    00462     virtual bool getValidationConstraintFatal() const = 0;
    00463
    00470     virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) = 0;
    00471
    00477     virtual Grammar* getRootGrammar() = 0;
    00478
    00485     virtual const XMLCh* getURIText(unsigned int uriId) const = 0;
    00486
    00493     virtual unsigned int getSrcOffset() const = 0;
    00494
    00496
    00497     // -----------------------------------------------------------------------
    00498     //  Setter Methods
    00499     // -----------------------------------------------------------------------
    00511     virtual void setValidator(XMLValidator* valueToAdopt) = 0;
    00512
    00534     virtual void setExitOnFirstFatalError(const bool newState) = 0;
    00535
    00561     virtual void setValidationConstraintFatal(const bool newState) = 0;
    00563
    00564
    00565     // -----------------------------------------------------------------------
    00566     //  Progressive scan methods
    00567     // -----------------------------------------------------------------------
    00568
    00571
    00599     virtual bool parseFirst
    00600     (
    00601         const   XMLCh* const    systemId
    00602         ,       XMLPScanToken&  toFill
    00603     ) = 0;
    00604
    00632     virtual bool parseFirst
    00633     (
    00634         const   char* const     systemId
    00635         ,       XMLPScanToken&  toFill
    00636     ) = 0;
    00637
    00665     virtual bool parseFirst
    00666     (
    00667         const   InputSource&    source
    00668         ,       XMLPScanToken&  toFill
    00669     ) = 0;
    00670
    00695     virtual bool parseNext(XMLPScanToken& token) = 0;
    00696
    00718     virtual void parseReset(XMLPScanToken& token) = 0;
    00719
    00721
    00722     // -----------------------------------------------------------------------
    00723     //  Grammar preparsing interface
    00724     // -----------------------------------------------------------------------
    00725
    00755     virtual Grammar* loadGrammar(const InputSource& source,
    00756                                  const short grammarType,
    00757                                  const bool toCache = false) = 0;
    00758
    00784     virtual Grammar* loadGrammar(const XMLCh* const systemId,
    00785                                  const short grammarType,
    00786                                  const bool toCache = false) = 0;
    00787
    00812     virtual Grammar* loadGrammar(const char* const systemId,
    00813                                  const short grammarType,
    00814                                  const bool toCache = false) = 0;
    00815
    00819     virtual void resetCachedGrammarPool() = 0;
    00820
    00831     virtual void setInputBufferSize(const size_t bufferSize);
    00832
    00834
    00835
    00836     // -----------------------------------------------------------------------
    00837     //  Advanced document handler list maintenance methods
    00838     // -----------------------------------------------------------------------
    00839
    00855     virtual void installAdvDocHandler(XMLDocumentHandler* const toInstall) = 0;
    00856
    00866     virtual bool removeAdvDocHandler(XMLDocumentHandler* const toRemove) = 0;
    00868
    00869 private :
    00870     /* The copy constructor, you cannot call this directly */
    00871     SAX2XMLReader(const SAX2XMLReader&);
    00872
    00873     /* The assignment operator, you cannot call this directly */
    00874     SAX2XMLReader& operator=(const SAX2XMLReader&);
    00875
    00876 };
    00877
    00878 inline void SAX2XMLReader::setInputBufferSize(const size_t /*bufferSize*/)
    00879 {
    00880 }
    00881
    00882 XERCES_CPP_NAMESPACE_END
    00883
    00884 #endif

Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.