source: icXML/icXML-devel/src/xercesc/validators/schema/identity/IC_Selector.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: 6.2 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;
39
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(FieldActivator* const fieldActivator,
67                                const int initialDepth,
68                                MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
69
70    /***
71     * Support for Serialization/De-serialization
72     ***/
73    DECL_XSERIALIZABLE(IC_Selector)
74
75    IC_Selector(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
76
77private:
78    // -----------------------------------------------------------------------
79    //  Unimplemented constructors and operators
80    // -----------------------------------------------------------------------
81    IC_Selector(const IC_Selector& other);
82    IC_Selector& operator= (const IC_Selector& other);
83
84    // -----------------------------------------------------------------------
85    //  Data members
86    // -----------------------------------------------------------------------
87    XercesXPath*        fXPath;
88    IdentityConstraint* fIdentityConstraint;
89};
90
91
92class VALIDATORS_EXPORT SelectorMatcher : public XPathMatcher
93{
94public:
95    // -----------------------------------------------------------------------
96    //  Constructors/Destructor
97    // -----------------------------------------------------------------------
98    ~SelectorMatcher() {}
99
100    int getInitialDepth() const { return fInitialDepth; }
101
102    // -----------------------------------------------------------------------
103    //  XMLDocumentHandler methods
104    // -----------------------------------------------------------------------
105    virtual void startDocumentFragment();
106    virtual void startElement(const XMLElementDecl& elemDecl,
107                              const unsigned int urlId,
108                              const XMLCh* const elemPrefix,
109                                      const RefVectorOf<XMLAttr>& attrList,
110                              const XMLSize_t attrCount,
111                              ValidationContext* validationContext = 0);
112    virtual void endElement(const XMLElementDecl& elemDecl,
113                            const XMLCh* const elemContent,
114                            ValidationContext* validationContext = 0,
115                            DatatypeValidator* actualValidator = 0);
116
117private:
118    // -----------------------------------------------------------------------
119    //  Constructors/Destructor
120    // -----------------------------------------------------------------------
121    SelectorMatcher(XercesXPath* const anXPath,
122                    IC_Selector* const selector,
123                    FieldActivator* const fieldActivator,
124                    const int initialDepth,
125                    MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
126
127    // -----------------------------------------------------------------------
128    //  Unimplemented constructors and operators
129    // -----------------------------------------------------------------------
130    SelectorMatcher(const SelectorMatcher& other);
131    SelectorMatcher& operator= (const SelectorMatcher& other);
132
133    // -----------------------------------------------------------------------
134    //  Friends
135    // -----------------------------------------------------------------------
136    friend class IC_Selector;
137
138    // -----------------------------------------------------------------------
139    //  Data members
140    // -----------------------------------------------------------------------
141    int             fInitialDepth;
142    int             fElementDepth;
143    int             fMatchedDepth;
144    IC_Selector*    fSelector;
145    FieldActivator* fFieldActivator;
146};
147
148XERCES_CPP_NAMESPACE_END
149
150#endif
151
152/**
153  * End of file IC_Selector.hpp
154  */
155
Note: See TracBrowser for help on using the repository browser.