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: ENTITYDatatypeValidator.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
20 | */ |
---|
21 | |
---|
22 | #if !defined(ENTITY_DATATYPEVALIDATOR_HPP) |
---|
23 | #define ENTITY_DATATYPEVALIDATOR_HPP |
---|
24 | |
---|
25 | #include <xercesc/validators/datatype/StringDatatypeValidator.hpp> |
---|
26 | #include <xercesc/util/NameIdPool.hpp> |
---|
27 | #include <xercesc/validators/DTD/DTDEntityDecl.hpp> |
---|
28 | |
---|
29 | XERCES_CPP_NAMESPACE_BEGIN |
---|
30 | |
---|
31 | class VALIDATORS_EXPORT ENTITYDatatypeValidator : public StringDatatypeValidator |
---|
32 | { |
---|
33 | public: |
---|
34 | |
---|
35 | // ----------------------------------------------------------------------- |
---|
36 | // Public ctor/dtor |
---|
37 | // ----------------------------------------------------------------------- |
---|
38 | /** @name Constructors and Destructor. */ |
---|
39 | //@{ |
---|
40 | |
---|
41 | ENTITYDatatypeValidator |
---|
42 | ( |
---|
43 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
44 | ); |
---|
45 | ENTITYDatatypeValidator |
---|
46 | ( |
---|
47 | DatatypeValidator* const baseValidator |
---|
48 | , RefHashTableOf<KVStringPair>* const facets |
---|
49 | , RefArrayVectorOf<XMLCh>* const enums |
---|
50 | , const int finalSet |
---|
51 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
52 | ); |
---|
53 | |
---|
54 | virtual ~ENTITYDatatypeValidator(); |
---|
55 | |
---|
56 | //@} |
---|
57 | |
---|
58 | // ----------------------------------------------------------------------- |
---|
59 | // Validation methods |
---|
60 | // ----------------------------------------------------------------------- |
---|
61 | /** @name Validation Function */ |
---|
62 | //@{ |
---|
63 | |
---|
64 | /** |
---|
65 | * validate that a string matches the boolean datatype |
---|
66 | * @param content A string containing the content to be validated |
---|
67 | * |
---|
68 | * @exception throws InvalidDatatypeException if the content is |
---|
69 | * is not valid. |
---|
70 | */ |
---|
71 | |
---|
72 | virtual void validate |
---|
73 | ( |
---|
74 | const XMLCh* const content |
---|
75 | , ValidationContext* const context = 0 |
---|
76 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
77 | ); |
---|
78 | |
---|
79 | //@} |
---|
80 | |
---|
81 | // ----------------------------------------------------------------------- |
---|
82 | // Compare methods |
---|
83 | // ----------------------------------------------------------------------- |
---|
84 | /** @name Compare Function */ |
---|
85 | //@{ |
---|
86 | |
---|
87 | /** |
---|
88 | * Compare two boolean data types |
---|
89 | * |
---|
90 | * @param content1 |
---|
91 | * @param content2 |
---|
92 | * @return |
---|
93 | */ |
---|
94 | virtual int compare(const XMLCh* const, const XMLCh* const |
---|
95 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
---|
96 | |
---|
97 | //@} |
---|
98 | |
---|
99 | /** |
---|
100 | * Returns an instance of the base datatype validator class |
---|
101 | * Used by the DatatypeValidatorFactory. |
---|
102 | */ |
---|
103 | virtual DatatypeValidator* newInstance |
---|
104 | ( |
---|
105 | RefHashTableOf<KVStringPair>* const facets |
---|
106 | , RefArrayVectorOf<XMLCh>* const enums |
---|
107 | , const int finalSet |
---|
108 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
109 | ); |
---|
110 | |
---|
111 | // ----------------------------------------------------------------------- |
---|
112 | // Setter methods |
---|
113 | // ----------------------------------------------------------------------- |
---|
114 | /** @name Setter Functions */ |
---|
115 | //@{ |
---|
116 | |
---|
117 | //deprecated |
---|
118 | inline void setEntityDeclPool(NameIdPool<DTDEntityDecl>* const entityDeclPool); |
---|
119 | |
---|
120 | //@} |
---|
121 | |
---|
122 | /*** |
---|
123 | * Support for Serialization/De-serialization |
---|
124 | ***/ |
---|
125 | DECL_XSERIALIZABLE(ENTITYDatatypeValidator) |
---|
126 | |
---|
127 | protected: |
---|
128 | |
---|
129 | // |
---|
130 | // ctor provided to be used by derived classes |
---|
131 | // |
---|
132 | ENTITYDatatypeValidator(DatatypeValidator* const baseValidator |
---|
133 | , RefHashTableOf<KVStringPair>* const facets |
---|
134 | , const int finalSet |
---|
135 | , const ValidatorType type); |
---|
136 | |
---|
137 | virtual void checkValueSpace(const XMLCh* const content |
---|
138 | , MemoryManager* const manager); |
---|
139 | |
---|
140 | private: |
---|
141 | // ----------------------------------------------------------------------- |
---|
142 | // Unimplemented constructors and operators |
---|
143 | // ----------------------------------------------------------------------- |
---|
144 | ENTITYDatatypeValidator(const ENTITYDatatypeValidator&); |
---|
145 | ENTITYDatatypeValidator& operator = (const ENTITYDatatypeValidator&); |
---|
146 | |
---|
147 | }; |
---|
148 | |
---|
149 | // ----------------------------------------------------------------------- |
---|
150 | // Setter methods |
---|
151 | // ----------------------------------------------------------------------- |
---|
152 | inline void ENTITYDatatypeValidator::setEntityDeclPool(NameIdPool<DTDEntityDecl>* const ) |
---|
153 | { |
---|
154 | } |
---|
155 | |
---|
156 | XERCES_CPP_NAMESPACE_END |
---|
157 | |
---|
158 | #endif |
---|
159 | |
---|
160 | /** |
---|
161 | * End of file ENTITYDatatypeValidator.hpp |
---|
162 | */ |
---|