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_VALIDATION_CONTEXTIMPL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_VALIDATION_CONTEXTIMPL_HPP
0024 
0025 #include <xercesc/framework/ValidationContext.hpp>
0026 
0027 XERCES_CPP_NAMESPACE_BEGIN
0028 class ElemStack;
0029 class NamespaceScope;
0030 
0031 class XMLPARSER_EXPORT ValidationContextImpl : public ValidationContext
0032 {
0033 public :
0034     // -----------------------------------------------------------------------
0035     /** @name Virtual destructor for derived classes */
0036     // -----------------------------------------------------------------------
0037     //@{
0038 
0039     /**
0040       * virtual destructor
0041       *
0042       */
0043     virtual ~ValidationContextImpl();
0044 
0045     ValidationContextImpl(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager);
0046 
0047     //@}
0048 
0049     // -----------------------------------------------------------------------
0050     /** @name The ValidationContextImpl Interface */
0051     // -----------------------------------------------------------------------
0052     //@{
0053 
0054     /**
0055       * IDRefList
0056       *
0057       */
0058     virtual RefHashTableOf<XMLRefInfo>*  getIdRefList() const;
0059 
0060     virtual void                         setIdRefList(RefHashTableOf<XMLRefInfo>* const);
0061 
0062     virtual void                         clearIdRefList();
0063 
0064     virtual void                         addId(const XMLCh * const );
0065 
0066     virtual void                         addIdRef(const XMLCh * const );
0067 
0068     virtual void                         toCheckIdRefList(bool);
0069 
0070     /**
0071       * EntityDeclPool
0072       *
0073       */
0074     virtual const NameIdPool<DTDEntityDecl>* getEntityDeclPool() const;
0075 
0076     virtual const NameIdPool<DTDEntityDecl>* setEntityDeclPool(const NameIdPool<DTDEntityDecl>* const);    
0077            
0078     virtual void                             checkEntity(const XMLCh * const ) const;
0079 
0080 
0081     /**
0082       * Union datatype handling
0083       *
0084       */
0085 
0086     virtual DatatypeValidator * getValidatingMemberType() const;
0087     virtual void setValidatingMemberType(DatatypeValidator * validatingMemberType) ;
0088 
0089     /**
0090       * QName datatype handling
0091       * Create default implementations for source code compatibility
0092       */
0093     virtual bool isPrefixUnknown(XMLCh* prefix);
0094     virtual void setElemStack(ElemStack* elemStack);
0095     virtual const XMLCh* getURIForPrefix(XMLCh* prefix);
0096     virtual void setScanner(XMLScanner* scanner);   
0097     virtual void setNamespaceScope(NamespaceScope* nsStack);
0098 
0099 
0100     //@}
0101   
0102 private:
0103     // -----------------------------------------------------------------------
0104     /** name  Unimplemented copy constructor and operator= */
0105     // -----------------------------------------------------------------------
0106     //@{
0107     ValidationContextImpl(const ValidationContextImpl& );
0108     ValidationContextImpl& operator=(const ValidationContextImpl& );
0109     //@}
0110 
0111     // -----------------------------------------------------------------------
0112     //  Data members
0113     //
0114     //  fIDRefList:  owned/adopted
0115     //      This is a list of XMLRefInfo objects. This member lets us do all
0116     //      needed ID-IDREF balancing checks.
0117     //
0118     //  fEntityDeclPool: referenced only
0119     //      This is a pool of EntityDecl objects, which contains all of the
0120     //      general entities that are declared in the DTD subsets, plus the
0121     //      default entities (such as &gt; &lt; ...) defined by the XML Standard.
0122     //
0123     //  fToAddToList
0124     //  fValidatingMemberType
0125     //      The member type in a union that actually
0126     //      validated some text.  Note that the validationContext does not
0127     //      own this object, and the value of getValidatingMemberType
0128     //      will not be accurate unless the type of the most recently-validated
0129     //      element/attribute is in fact a union datatype.
0130     //  fElemStack
0131     //      Need access to elemstack to look up URI's that are inscope (while validating an XML).
0132     //  fNamespaceScope
0133     //      Need access to namespace scope to look up URI's that are inscope (while loading a schema).
0134     // -----------------------------------------------------------------------
0135 
0136     RefHashTableOf<XMLRefInfo>*         fIdRefList;
0137     const NameIdPool<DTDEntityDecl>*    fEntityDeclPool;
0138     bool                                fToCheckIdRefList;
0139     DatatypeValidator *                 fValidatingMemberType;    
0140     ElemStack*                          fElemStack;
0141     XMLScanner*                         fScanner;
0142     NamespaceScope*                     fNamespaceScope;
0143 
0144 };
0145 
0146 
0147 
0148 inline DatatypeValidator * ValidationContextImpl::getValidatingMemberType() const
0149 {
0150     return fValidatingMemberType;
0151 }
0152 
0153 inline void ValidationContextImpl::setValidatingMemberType(DatatypeValidator * validatingMemberType) 
0154 {
0155     fValidatingMemberType = validatingMemberType;
0156 }
0157 
0158 inline void ValidationContextImpl::setElemStack(ElemStack* elemStack) {
0159     fElemStack = elemStack;
0160 }
0161 
0162 inline void ValidationContextImpl::setScanner(XMLScanner* scanner) {
0163     fScanner = scanner;
0164 }
0165 
0166 inline void ValidationContextImpl::setNamespaceScope(NamespaceScope* nsStack) {
0167     fNamespaceScope = nsStack;
0168 }
0169 
0170 XERCES_CPP_NAMESPACE_END
0171 
0172 #endif
0173