source: icXML/icXML-devel/src/xercesc/validators/schema/SubstitutionGroupComparator.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 4.3 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: SubstitutionGroupComparator.hpp 932887 2010-04-11 13:04:59Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_SUBSTITUTIONGROUPCOMPARATOR_HPP)
23#define XERCESC_INCLUDE_GUARD_SUBSTITUTIONGROUPCOMPARATOR_HPP
24
25#include <xercesc/util/StringPool.hpp>
26#include <icxercesc/util/QName.hpp>
27#include <icxercesc/validators/common/GrammarResolver.hpp>
28
29XERCES_CPP_NAMESPACE_BEGIN
30
31class SchemaGrammar;
32
33class VALIDATORS_EXPORT SubstitutionGroupComparator : public XMemory
34{
35public:
36
37    // -----------------------------------------------------------------------
38    //  Public Constructor
39    // -----------------------------------------------------------------------
40    /** @name Constructor. */
41    //@{
42
43    SubstitutionGroupComparator(GrammarResolver*  const pGrammarResolver
44                              , XMLStringPool*    const pStringPool);
45
46
47    //@}
48
49    // -----------------------------------------------------------------------
50    //  Public Destructor
51    // -----------------------------------------------------------------------
52    /** @name Destructor. */
53    //@{
54
55    ~SubstitutionGroupComparator();
56
57    //@}
58
59    // -----------------------------------------------------------------------
60    // Validation methods
61    // -----------------------------------------------------------------------
62    /** @name Validation Function */
63    //@{
64
65    /**
66           * Checks that the "anElement" is within the substitution group.
67           *
68           * @param  anElement   QName of the element
69           *
70           * @param  exemplar     QName of the head element in the group
71           */
72    bool isEquivalentTo(const QName* const anElement
73                      , const QName* const exemplar);
74         //@}
75
76    /*
77     * check whether one element or any element in its substitution group
78     * is allowed by a given wildcard uri
79     *
80     * @param pGrammar the grammar where the wildcard is declared
81     * @param element  the QName of a given element
82     * @param wuri     the uri of the wildcard
83     * @param wother   whether the uri is from ##other, so wuri is excluded
84     *
85     * @return whether the element is allowed by the wildcard
86     */
87    bool isAllowedByWildcard(SchemaGrammar* const pGrammar, QName* const element, unsigned int wuri, bool wother);
88
89private:
90    // -----------------------------------------------------------------------
91    //  Unimplemented constructors and operators
92    // -----------------------------------------------------------------------
93    SubstitutionGroupComparator();
94    SubstitutionGroupComparator(const SubstitutionGroupComparator&);
95    SubstitutionGroupComparator& operator=(const SubstitutionGroupComparator&);
96   
97    // -----------------------------------------------------------------------
98    //  Private data members
99    //
100    //
101    // -----------------------------------------------------------------------
102    GrammarResolver     *fGrammarResolver;
103    XMLStringPool       *fStringPool;
104};
105
106
107// ---------------------------------------------------------------------------
108//  SubstitutionGroupComparator: Getters
109// ---------------------------------------------------------------------------
110inline SubstitutionGroupComparator::SubstitutionGroupComparator(GrammarResolver*  const pGrammarResolver
111                                                              , XMLStringPool*    const pStringPool)
112:fGrammarResolver(pGrammarResolver)
113,fStringPool(pStringPool)
114{}
115
116inline SubstitutionGroupComparator::~SubstitutionGroupComparator()
117{}
118
119XERCES_CPP_NAMESPACE_END
120
121#endif
122
123/**
124  * End of file SubstitutionGroupComparator.hpp
125  */
126
Note: See TracBrowser for help on using the repository browser.