1 | /*
|
---|
2 | * Copyright 1999-2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Log: ValidationContextImpl.hpp,v $
|
---|
19 | * Revision 1.3 2004/09/08 13:56:13 peiyongz
|
---|
20 | * Apache License Version 2.0
|
---|
21 | *
|
---|
22 | * Revision 1.2 2003/11/24 05:10:26 neilg
|
---|
23 | * implement method for determining member type of union that validated some value
|
---|
24 | *
|
---|
25 | * Revision 1.1 2003/11/12 20:29:47 peiyongz
|
---|
26 | * Stateless Grammar: ValidationContext
|
---|
27 | *
|
---|
28 | * $Id: ValidationContextImpl.hpp,v 1.3 2004/09/08 13:56:13 peiyongz Exp $
|
---|
29 | *
|
---|
30 | */
|
---|
31 |
|
---|
32 | #if !defined(VALIDATION_CONTEXTIMPL_HPP)
|
---|
33 | #define VALIDATION_CONTEXTIMPL_HPP
|
---|
34 |
|
---|
35 | #include <xercesc/framework/ValidationContext.hpp>
|
---|
36 |
|
---|
37 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
38 |
|
---|
39 | class XMLPARSER_EXPORT ValidationContextImpl : public ValidationContext
|
---|
40 | {
|
---|
41 | public :
|
---|
42 | // -----------------------------------------------------------------------
|
---|
43 | /** @name Virtual destructor for derived classes */
|
---|
44 | // -----------------------------------------------------------------------
|
---|
45 | //@{
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * virtual destructor
|
---|
49 | *
|
---|
50 | */
|
---|
51 | virtual ~ValidationContextImpl();
|
---|
52 |
|
---|
53 | ValidationContextImpl(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager);
|
---|
54 |
|
---|
55 | //@}
|
---|
56 |
|
---|
57 | // -----------------------------------------------------------------------
|
---|
58 | /** @name The ValidationContextImpl Interface */
|
---|
59 | // -----------------------------------------------------------------------
|
---|
60 | //@{
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * IDRefList
|
---|
64 | *
|
---|
65 | */
|
---|
66 | virtual RefHashTableOf<XMLRefInfo>* getIdRefList() const;
|
---|
67 |
|
---|
68 | virtual void setIdRefList(RefHashTableOf<XMLRefInfo>* const);
|
---|
69 |
|
---|
70 | virtual void clearIdRefList();
|
---|
71 |
|
---|
72 | virtual void addId(const XMLCh * const );
|
---|
73 |
|
---|
74 | virtual void addIdRef(const XMLCh * const );
|
---|
75 |
|
---|
76 | virtual void toCheckIdRefList(bool);
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * EntityDeclPool
|
---|
80 | *
|
---|
81 | */
|
---|
82 | virtual const NameIdPool<DTDEntityDecl>* getEntityDeclPool() const;
|
---|
83 |
|
---|
84 | virtual const NameIdPool<DTDEntityDecl>* setEntityDeclPool(const NameIdPool<DTDEntityDecl>* const);
|
---|
85 |
|
---|
86 | virtual void checkEntity(const XMLCh * const ) const;
|
---|
87 |
|
---|
88 |
|
---|
89 | /**
|
---|
90 | * Union datatype handling
|
---|
91 | *
|
---|
92 | */
|
---|
93 |
|
---|
94 | virtual DatatypeValidator * getValidatingMemberType() const;
|
---|
95 | virtual void setValidatingMemberType(DatatypeValidator * validatingMemberType) ;
|
---|
96 |
|
---|
97 | //@}
|
---|
98 |
|
---|
99 | private:
|
---|
100 | // -----------------------------------------------------------------------
|
---|
101 | /** name Unimplemented copy constructor and operator= */
|
---|
102 | // -----------------------------------------------------------------------
|
---|
103 | //@{
|
---|
104 | ValidationContextImpl(const ValidationContextImpl& );
|
---|
105 | ValidationContextImpl& operator=(const ValidationContextImpl& );
|
---|
106 | //@}
|
---|
107 |
|
---|
108 | // -----------------------------------------------------------------------
|
---|
109 | // Data members
|
---|
110 | //
|
---|
111 | // fIDRefList: owned/adopted
|
---|
112 | // This is a list of XMLRefInfo objects. This member lets us do all
|
---|
113 | // needed ID-IDREF balancing checks.
|
---|
114 | //
|
---|
115 | // fEntityDeclPool: referenced only
|
---|
116 | // This is a pool of EntityDecl objects, which contains all of the
|
---|
117 | // general entities that are declared in the DTD subsets, plus the
|
---|
118 | // default entities (such as > < ...) defined by the XML Standard.
|
---|
119 | //
|
---|
120 | // fToAddToList
|
---|
121 | // fValidatingMemberType
|
---|
122 | // The member type in a union that actually
|
---|
123 | // validated some text. Note that the validationContext does not
|
---|
124 | // own this object, and the value of getValidatingMemberType
|
---|
125 | // will not be accurate unless the type of the most recently-validated
|
---|
126 | // element/attribute is in fact a union datatype.
|
---|
127 | // -----------------------------------------------------------------------
|
---|
128 |
|
---|
129 | RefHashTableOf<XMLRefInfo>* fIdRefList;
|
---|
130 | const NameIdPool<DTDEntityDecl>* fEntityDeclPool;
|
---|
131 | bool fToCheckIdRefList;
|
---|
132 | DatatypeValidator * fValidatingMemberType;
|
---|
133 |
|
---|
134 | };
|
---|
135 |
|
---|
136 |
|
---|
137 |
|
---|
138 | inline DatatypeValidator * ValidationContextImpl::getValidatingMemberType() const
|
---|
139 | {
|
---|
140 | return fValidatingMemberType;
|
---|
141 | }
|
---|
142 |
|
---|
143 | inline void ValidationContextImpl::setValidatingMemberType(DatatypeValidator * validatingMemberType)
|
---|
144 | {
|
---|
145 | fValidatingMemberType = validatingMemberType;
|
---|
146 | }
|
---|
147 |
|
---|
148 | XERCES_CPP_NAMESPACE_END
|
---|
149 |
|
---|
150 | #endif
|
---|
151 |
|
---|