Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:55

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  * 
0009  *      http://www.apache.org/licenses/LICENSE-2.0
0010  * 
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 /*
0019  * $Id$
0020  */
0021 
0022 #if !defined(XERCESC_INCLUDE_GUARD_WFXMLSCANNER_HPP)
0023 #define XERCESC_INCLUDE_GUARD_WFXMLSCANNER_HPP
0024 
0025 #include <xercesc/internal/XMLScanner.hpp>
0026 #include <xercesc/util/ValueHashTableOf.hpp>
0027 #include <xercesc/util/ValueVectorOf.hpp>
0028 #include <xercesc/validators/DTD/DTDElementDecl.hpp>
0029 
0030 XERCES_CPP_NAMESPACE_BEGIN
0031 
0032 
0033 //  This is a a non-validating scanner. No DOCTYPE or XML Schema processing
0034 //  will take place.
0035 class XMLPARSER_EXPORT WFXMLScanner : public XMLScanner
0036 {
0037 public :
0038     // -----------------------------------------------------------------------
0039     //  Constructors and Destructor
0040     // -----------------------------------------------------------------------
0041     WFXMLScanner
0042     (
0043         XMLValidator* const       valToAdopt
0044         , GrammarResolver* const  grammarResolver
0045         , MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager
0046     );
0047     WFXMLScanner
0048     (
0049         XMLDocumentHandler* const docHandler
0050         , DocTypeHandler* const   docTypeHandler
0051         , XMLEntityHandler* const entityHandler
0052         , XMLErrorReporter* const errReporter
0053         , XMLValidator* const     valToAdopt
0054         , GrammarResolver* const  grammarResolver
0055         , MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager
0056     );
0057     virtual ~WFXMLScanner();
0058 
0059     // -----------------------------------------------------------------------
0060     //  XMLScanner public virtual methods
0061     // -----------------------------------------------------------------------
0062     virtual const XMLCh* getName() const;
0063     virtual NameIdPool<DTDEntityDecl>* getEntityDeclPool();
0064     virtual const NameIdPool<DTDEntityDecl>* getEntityDeclPool() const;
0065     virtual void scanDocument
0066     (
0067         const   InputSource&    src
0068     );
0069     virtual bool scanNext(XMLPScanToken& toFill);
0070     virtual Grammar* loadGrammar
0071     (
0072         const   InputSource&    src
0073         , const short           grammarType
0074         , const bool            toCache = false
0075     );
0076 
0077 private :
0078     // -----------------------------------------------------------------------
0079     //  Unimplemented constructors and operators
0080     // -----------------------------------------------------------------------
0081     WFXMLScanner();
0082     WFXMLScanner(const WFXMLScanner&);
0083     WFXMLScanner& operator=(const WFXMLScanner&);
0084 
0085     // -----------------------------------------------------------------------
0086     //  XMLScanner virtual methods
0087     // -----------------------------------------------------------------------
0088     virtual void scanCDSection();
0089     virtual void scanCharData(XMLBuffer& toToUse);
0090     virtual EntityExpRes scanEntityRef
0091     (
0092         const   bool    inAttVal
0093         ,       XMLCh&  firstCh
0094         ,       XMLCh&  secondCh
0095         ,       bool&   escaped
0096     );
0097     virtual void scanDocTypeDecl();
0098     virtual void scanReset(const InputSource& src);
0099     virtual void sendCharData(XMLBuffer& toSend);
0100     virtual InputSource* resolveSystemId(const XMLCh* const sysId
0101                                         ,const XMLCh* const pubId);
0102 
0103     // -----------------------------------------------------------------------
0104     //  Private helper methods
0105     // -----------------------------------------------------------------------
0106     void commonInit();
0107     void cleanUp();
0108 
0109     // -----------------------------------------------------------------------
0110     //  Private scanning methods
0111     // -----------------------------------------------------------------------
0112     bool scanAttValue
0113     (
0114         const   XMLCh* const    attrName
0115         ,       XMLBuffer&      toFill
0116     );
0117     bool scanContent();
0118     void scanEndTag(bool& gotData);
0119     bool scanStartTag(bool& gotData);
0120     bool scanStartTagNS(bool& gotData);
0121 
0122     // -----------------------------------------------------------------------
0123     //  Data members
0124     //
0125     //  fEntityTable
0126     //      This the table that contains the default entity entries.
0127     //
0128     //  fAttrNameHashList
0129     //      This contains the hash value for attribute names. It's used when
0130     //      checking for duplicate attributes.
0131     //
0132     //  fAttrNSList
0133     //      This contains XMLAttr objects that we need to map their prefixes
0134     //      to URIs when namespace is enabled.
0135     //
0136     // -----------------------------------------------------------------------
0137     unsigned int                       fElementIndex;
0138     RefVectorOf<XMLElementDecl>*       fElements;
0139     ValueHashTableOf<XMLCh>*           fEntityTable;
0140     ValueVectorOf<XMLSize_t>*          fAttrNameHashList;
0141     ValueVectorOf<XMLAttr*>*           fAttrNSList;
0142     RefHashTableOf<XMLElementDecl>*    fElementLookup;  
0143 };
0144 
0145 inline const XMLCh* WFXMLScanner::getName() const
0146 {
0147     return XMLUni::fgWFXMLScanner;
0148 }
0149 
0150 
0151 XERCES_CPP_NAMESPACE_END
0152 
0153 #endif