source: icXML/icXML-devel/src/icxercesc/internal/ValidationContextImpl.hpp @ 2720

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

Initial check-in of icXML 0.8 source files

File size: 4.9 KB
Line 
1/*
2 * Unless required by applicable law or agreed to in writing, software
3 * distributed under the License is distributed on an "AS IS" BASIS,
4 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 * See the License for the specific language governing permissions and
6 * limitations under the License.
7 */
8
9/*
10 * $Id: ValidationContextImpl.hpp 729944 2008-12-29 17:03:32Z amassari $
11 */
12
13#if !defined(XERCESC_INCLUDE_GUARD_VALIDATION_CONTEXTIMPL_HPP)
14#define XERCESC_INCLUDE_GUARD_VALIDATION_CONTEXTIMPL_HPP
15
16#include <xercesc/framework/ValidationContext.hpp>
17#include <icxmlc/XMLConfig.hpp>
18
19XERCES_CPP_NAMESPACE_BEGIN
20class ElemStack;
21class NamespaceScope;
22
23class XMLPARSER_EXPORT ValidationContextImpl : public ValidationContext
24{
25public :
26        // -----------------------------------------------------------------------
27        /** @name Virtual destructor for derived classes */
28        // -----------------------------------------------------------------------
29        //@{
30
31        /**
32          * virtual destructor
33          *
34          */
35        virtual ~ValidationContextImpl();
36
37        ValidationContextImpl(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager);
38
39        //@}
40
41        // -----------------------------------------------------------------------
42        /** @name The ValidationContextImpl Interface */
43        // -----------------------------------------------------------------------
44        //@{
45
46        /**
47          * IDRefList
48          *
49          */
50        virtual RefHashTableOf<XMLRefInfo>*  getIdRefList() const;
51
52        virtual void                         setIdRefList(RefHashTableOf<XMLRefInfo>* const);
53
54        virtual void                         clearIdRefList();
55
56        virtual void                         addId(const XMLCh * const );
57
58        virtual void                         addIdRef(const XMLCh * const );
59
60        virtual void                         toCheckIdRefList(bool);
61
62        /**
63          * EntityDeclPool
64          *
65          */
66        virtual const NameIdPool<DTDEntityDecl>* getEntityDeclPool() const;
67
68        virtual const NameIdPool<DTDEntityDecl>* setEntityDeclPool(const NameIdPool<DTDEntityDecl>* const);
69
70        virtual void                             checkEntity(const XMLCh * const ) const;
71
72
73        /**
74          * Union datatype handling
75          *
76          */
77
78        virtual DatatypeValidator * getValidatingMemberType() const;
79        virtual void setValidatingMemberType(DatatypeValidator * validatingMemberType) ;
80
81        /**
82          * QName datatype handling
83          * Create default implementations for source code compatibility
84          */
85        virtual bool isPrefixUnknown(XMLCh* prefix);
86        virtual void setElemStack(ElemStack* elemStack);
87        virtual const XMLCh* getURIForPrefix(XMLCh* prefix);
88        virtual void setScanner(XMLScanner* scanner);
89        virtual void setNamespaceScope(NamespaceScope* nsStack);
90
91
92        //@}
93
94private:
95        // -----------------------------------------------------------------------
96        /** name  Unimplemented copy constructor and operator= */
97        // -----------------------------------------------------------------------
98        //@{
99        ValidationContextImpl(const ValidationContextImpl& );
100        ValidationContextImpl& operator=(const ValidationContextImpl& );
101        //@}
102
103        // -----------------------------------------------------------------------
104        //  Data members
105        //
106        //  fIDRefList:  owned/adopted
107        //      This is a list of XMLRefInfo objects. This member lets us do all
108        //      needed ID-IDREF balancing checks.
109        //
110        //  fEntityDeclPool: referenced only
111        //      This is a pool of EntityDecl objects, which contains all of the
112        //      general entities that are declared in the DTD subsets, plus the
113        //      default entities (such as &gt; &lt; ...) defined by the XML Standard.
114        //
115        //  fToAddToList
116        //  fValidatingMemberType
117        //      The member type in a union that actually
118        //      validated some text.  Note that the validationContext does not
119        //      own this object, and the value of getValidatingMemberType
120        //      will not be accurate unless the type of the most recently-validated
121        //      element/attribute is in fact a union datatype.
122        //  fNamespaceScope
123        //      Need access to namespace scope to look up URI's that are inscope (while loading a schema).
124        // -----------------------------------------------------------------------
125
126        RefHashTableOf<XMLRefInfo>*         fIdRefList;
127        const NameIdPool<DTDEntityDecl>*    fEntityDeclPool;
128        bool                                fToCheckIdRefList;
129        DatatypeValidator *                 fValidatingMemberType;
130        XMLScanner*                         fScanner;
131        NamespaceScope*                     fNamespaceScope;
132};
133
134
135
136inline DatatypeValidator * ValidationContextImpl::getValidatingMemberType() const
137{
138        return fValidatingMemberType;
139}
140
141inline void ValidationContextImpl::setValidatingMemberType(DatatypeValidator * validatingMemberType)
142{
143        fValidatingMemberType = validatingMemberType;
144}
145
146inline void ValidationContextImpl::setElemStack(ElemStack*)
147{
148        DEPRECATED_FEATURE_IN_ICXML;
149}
150
151inline void ValidationContextImpl::setScanner(XMLScanner* scanner)
152{
153        fScanner = scanner;
154}
155
156inline void ValidationContextImpl::setNamespaceScope(NamespaceScope* nsStack)
157{
158        fNamespaceScope = nsStack;
159}
160
161XERCES_CPP_NAMESPACE_END
162
163#endif
164
Note: See TracBrowser for help on using the repository browser.