Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:20

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_SUBSTITUTIONGROUPCOMPARATOR_HPP)
0023 #define XERCESC_INCLUDE_GUARD_SUBSTITUTIONGROUPCOMPARATOR_HPP
0024 
0025 #include <xercesc/util/StringPool.hpp>
0026 #include <xercesc/util/QName.hpp>
0027 #include <xercesc/validators/common/GrammarResolver.hpp>
0028 
0029 XERCES_CPP_NAMESPACE_BEGIN
0030 
0031 class SchemaGrammar;
0032 
0033 class VALIDATORS_EXPORT SubstitutionGroupComparator : public XMemory
0034 {
0035 public:
0036 
0037     // -----------------------------------------------------------------------
0038     //  Public Constructor
0039     // -----------------------------------------------------------------------
0040     /** @name Constructor. */
0041     //@{
0042 
0043     SubstitutionGroupComparator(GrammarResolver*  const pGrammarResolver
0044                               , XMLStringPool*    const pStringPool);
0045 
0046 
0047     //@}
0048 
0049     // -----------------------------------------------------------------------
0050     //  Public Destructor
0051     // -----------------------------------------------------------------------
0052     /** @name Destructor. */
0053     //@{
0054 
0055     ~SubstitutionGroupComparator();
0056 
0057     //@}
0058 
0059     // -----------------------------------------------------------------------
0060     // Validation methods
0061     // -----------------------------------------------------------------------
0062     /** @name Validation Function */
0063     //@{
0064 
0065     /**
0066        * Checks that the "anElement" is within the substitution group.
0067        *
0068        * @param  anElement   QName of the element
0069        *
0070        * @param  exemplar     QName of the head element in the group
0071        */
0072     bool isEquivalentTo(const QName* const anElement
0073                       , const QName* const exemplar);
0074      //@}
0075 
0076     /*
0077      * check whether one element or any element in its substitution group
0078      * is allowed by a given wildcard uri
0079      *
0080      * @param pGrammar the grammar where the wildcard is declared
0081      * @param element  the QName of a given element
0082      * @param wuri     the uri of the wildcard
0083      * @param wother   whether the uri is from ##other, so wuri is excluded
0084      *
0085      * @return whether the element is allowed by the wildcard
0086      */
0087     bool isAllowedByWildcard(SchemaGrammar* const pGrammar, QName* const element, unsigned int wuri, bool wother);
0088 
0089 private:
0090     // -----------------------------------------------------------------------
0091     //  Unimplemented constructors and operators
0092     // -----------------------------------------------------------------------
0093     SubstitutionGroupComparator();
0094     SubstitutionGroupComparator(const SubstitutionGroupComparator&);
0095     SubstitutionGroupComparator& operator=(const SubstitutionGroupComparator&);
0096     
0097     // -----------------------------------------------------------------------
0098     //  Private data members
0099     //
0100     //
0101     // -----------------------------------------------------------------------
0102     GrammarResolver     *fGrammarResolver;
0103     XMLStringPool       *fStringPool;
0104 };
0105 
0106 
0107 // ---------------------------------------------------------------------------
0108 //  SubstitutionGroupComparator: Getters
0109 // ---------------------------------------------------------------------------
0110 inline SubstitutionGroupComparator::SubstitutionGroupComparator(GrammarResolver*  const pGrammarResolver
0111                                                               , XMLStringPool*    const pStringPool)
0112 :fGrammarResolver(pGrammarResolver)
0113 ,fStringPool(pStringPool)
0114 {}
0115 
0116 inline SubstitutionGroupComparator::~SubstitutionGroupComparator()
0117 {}
0118 
0119 XERCES_CPP_NAMESPACE_END
0120 
0121 #endif
0122 
0123 /**
0124   * End of file SubstitutionGroupComparator.hpp
0125   */
0126