source: icXML/icXML-devel/src/xercesc/validators/schema/identity/IC_Selector.hpp @ 3565

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

Updates to xercesc sources

File size: 6.8 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: IC_Selector.hpp 932887 2010-04-11 13:04:59Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_IC_SELECTOR_HPP)
23#define XERCESC_INCLUDE_GUARD_IC_SELECTOR_HPP
24
25
26// ---------------------------------------------------------------------------
27//  Includes
28// ---------------------------------------------------------------------------
29#include <xercesc/validators/schema/identity/XPathMatcher.hpp>
30
31#include <xercesc/internal/XSerializable.hpp>
32
33XERCES_CPP_NAMESPACE_BEGIN
34
35// ---------------------------------------------------------------------------
36//  Forward Declaration
37// ---------------------------------------------------------------------------
38class FieldActivator;
39class XMLStringPool;
40
41class VALIDATORS_EXPORT IC_Selector : public XSerializable, public XMemory
42{
43public:
44    // -----------------------------------------------------------------------
45    //  Constructors/Destructor
46    // -----------------------------------------------------------------------
47    IC_Selector(XercesXPath* const xpath,
48                IdentityConstraint* const identityConstraint);
49        ~IC_Selector();
50
51    // -----------------------------------------------------------------------
52    //  operators
53    // -----------------------------------------------------------------------
54    bool operator== (const IC_Selector& other) const;
55    bool operator!= (const IC_Selector& other) const;
56
57        // -----------------------------------------------------------------------
58    //  Getter methods
59    // -----------------------------------------------------------------------
60    XercesXPath* getXPath() const { return fXPath; }
61    IdentityConstraint* getIdentityConstraint() const { return fIdentityConstraint; }
62
63        // -----------------------------------------------------------------------
64    //  Factory methods
65    // -----------------------------------------------------------------------
66    XPathMatcher* createMatcher
67    (
68        FieldActivator* const   fieldActivator
69        , const int             initialDepth
70        , XMLStringPool * const stringPool
71        , MemoryManager * const manager = XMLPlatformUtils::fgMemoryManager
72    );
73
74    XPathMatcher* createMatcher
75    (
76        FieldActivator* const   fieldActivator
77        , const int             initialDepth
78        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
79    );
80
81    /***
82     * Support for Serialization/De-serialization
83     ***/
84    DECL_XSERIALIZABLE(IC_Selector)
85
86    IC_Selector(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
87
88private:
89    // -----------------------------------------------------------------------
90    //  Unimplemented constructors and operators
91    // -----------------------------------------------------------------------
92    IC_Selector(const IC_Selector& other);
93    IC_Selector& operator= (const IC_Selector& other);
94
95    // -----------------------------------------------------------------------
96    //  Data members
97    // -----------------------------------------------------------------------
98    XercesXPath*        fXPath;
99    IdentityConstraint* fIdentityConstraint;
100};
101
102
103class VALIDATORS_EXPORT SelectorMatcher : public XPathMatcher
104{
105public:
106    // -----------------------------------------------------------------------
107    //  Constructors/Destructor
108    // -----------------------------------------------------------------------
109    ~SelectorMatcher() {}
110
111    int getInitialDepth() const { return fInitialDepth; }
112
113    // -----------------------------------------------------------------------
114    //  XMLDocumentHandler methods
115    // -----------------------------------------------------------------------
116    virtual void startDocumentFragment();
117    virtual void startElement(const XMLElementDecl& elemDecl,
118                              const unsigned int urlId,
119                              const XMLCh* const elemPrefix,
120                                      const RefVectorOf<XMLAttr>& attrList,
121                              const XMLSize_t attrCount,
122                              ValidationContext* validationContext = 0);
123    virtual void endElement(const XMLElementDecl& elemDecl,
124                            const XMLCh* const elemContent,
125                            ValidationContext* validationContext = 0,
126                            DatatypeValidator* actualValidator = 0);
127
128private:
129    // -----------------------------------------------------------------------
130    //  Constructors/Destructor
131    // -----------------------------------------------------------------------
132    SelectorMatcher
133    (
134        XercesXPath* const      anXPath,
135        IC_Selector* const      selector,
136        FieldActivator* const   fieldActivator,
137        const int               initialDepth,
138        MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager
139    );
140
141    SelectorMatcher
142    (
143        XercesXPath* const      anXPath,
144        IC_Selector* const      selector,
145        FieldActivator* const   fieldActivator,
146        const int               initialDepth,
147        XMLStringPool * const   stringPool,
148        MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager
149    );
150
151    // -----------------------------------------------------------------------
152    //  Unimplemented constructors and operators
153    // -----------------------------------------------------------------------
154    SelectorMatcher(const SelectorMatcher& other);
155    SelectorMatcher& operator= (const SelectorMatcher& other);
156
157    // -----------------------------------------------------------------------
158    //  Friends
159    // -----------------------------------------------------------------------
160    friend class IC_Selector;
161
162    // -----------------------------------------------------------------------
163    //  Data members
164    // -----------------------------------------------------------------------
165    int             fInitialDepth;
166    int             fElementDepth;
167    int             fMatchedDepth;
168    IC_Selector*    fSelector;
169    XMLStringPool*  fStringPool;
170    FieldActivator* fFieldActivator;
171};
172
173XERCES_CPP_NAMESPACE_END
174
175#endif
176
177/**
178  * End of file IC_Selector.hpp
179  */
180
Note: See TracBrowser for help on using the repository browser.