1 | /*
|
---|
2 | * Copyright 2001,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 | * $Id: NameDatatypeValidator.hpp,v 1.9 2004/09/08 13:56:53 peiyongz Exp $
|
---|
19 | * $Log: NameDatatypeValidator.hpp,v $
|
---|
20 | * Revision 1.9 2004/09/08 13:56:53 peiyongz
|
---|
21 | * Apache License Version 2.0
|
---|
22 | *
|
---|
23 | * Revision 1.8 2004/01/29 11:51:22 cargilld
|
---|
24 | * Code cleanup changes to get rid of various compiler diagnostic messages.
|
---|
25 | *
|
---|
26 | * Revision 1.7 2003/12/17 00:18:39 cargilld
|
---|
27 | * Update to memory management so that the static memory manager (one used to call Initialize) is only for static data.
|
---|
28 | *
|
---|
29 | * Revision 1.6 2003/11/12 20:32:03 peiyongz
|
---|
30 | * Statless Grammar: ValidationContext
|
---|
31 | *
|
---|
32 | * Revision 1.5 2003/09/30 18:17:53 peiyongz
|
---|
33 | * Implementation of Serialization/Deserialization
|
---|
34 | *
|
---|
35 | * Revision 1.4 2003/05/15 18:53:27 knoaman
|
---|
36 | * Partial implementation of the configurable memory manager.
|
---|
37 | *
|
---|
38 | * Revision 1.3 2002/12/18 14:17:55 gareth
|
---|
39 | * Fix to bug #13438. When you eant a vector that calls delete[] on its members you should use RefArrayVectorOf.
|
---|
40 | *
|
---|
41 | * Revision 1.2 2002/11/04 14:53:28 tng
|
---|
42 | * C++ Namespace Support.
|
---|
43 | *
|
---|
44 | * Revision 1.1.1.1 2002/02/01 22:22:42 peiyongz
|
---|
45 | * sane_include
|
---|
46 | *
|
---|
47 | * Revision 1.3 2001/10/09 20:48:39 peiyongz
|
---|
48 | * init(): take 1 arg
|
---|
49 | *
|
---|
50 | * Revision 1.2 2001/09/27 13:51:25 peiyongz
|
---|
51 | * DTV Reorganization: ctor/init created to be used by derived class
|
---|
52 | *
|
---|
53 | * Revision 1.1 2001/09/25 15:58:45 peiyongz
|
---|
54 | * DTV Reorganization: new class
|
---|
55 | *
|
---|
56 | */
|
---|
57 |
|
---|
58 | #if !defined(NAME_DATATYPEVALIDATOR_HPP)
|
---|
59 | #define NAME_DATATYPEVALIDATOR_HPP
|
---|
60 |
|
---|
61 | #include <xercesc/validators/datatype/StringDatatypeValidator.hpp>
|
---|
62 |
|
---|
63 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
64 |
|
---|
65 | class VALIDATORS_EXPORT NameDatatypeValidator : public StringDatatypeValidator
|
---|
66 | {
|
---|
67 | public:
|
---|
68 |
|
---|
69 | // -----------------------------------------------------------------------
|
---|
70 | // Public ctor/dtor
|
---|
71 | // -----------------------------------------------------------------------
|
---|
72 | /** @name Constructors and Destructor */
|
---|
73 | //@{
|
---|
74 |
|
---|
75 | NameDatatypeValidator
|
---|
76 | (
|
---|
77 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
78 | );
|
---|
79 | NameDatatypeValidator
|
---|
80 | (
|
---|
81 | DatatypeValidator* const baseValidator
|
---|
82 | , RefHashTableOf<KVStringPair>* const facets
|
---|
83 | , RefArrayVectorOf<XMLCh>* const enums
|
---|
84 | , const int finalSet
|
---|
85 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
86 | );
|
---|
87 | virtual ~NameDatatypeValidator();
|
---|
88 |
|
---|
89 | //@}
|
---|
90 |
|
---|
91 | // -----------------------------------------------------------------------
|
---|
92 | // Validation methods
|
---|
93 | // -----------------------------------------------------------------------
|
---|
94 | /** @name Validation Function */
|
---|
95 | //@{
|
---|
96 |
|
---|
97 | /**
|
---|
98 | * validate that a string matches the boolean datatype
|
---|
99 | * @param content A string containing the content to be validated
|
---|
100 | *
|
---|
101 | * @exception throws InvalidDatatypeException if the content is
|
---|
102 | * is not valid.
|
---|
103 | */
|
---|
104 |
|
---|
105 | virtual void validate
|
---|
106 | (
|
---|
107 | const XMLCh* const content
|
---|
108 | , ValidationContext* const context = 0
|
---|
109 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
110 | );
|
---|
111 |
|
---|
112 | //@}
|
---|
113 |
|
---|
114 | // -----------------------------------------------------------------------
|
---|
115 | // Compare methods
|
---|
116 | // -----------------------------------------------------------------------
|
---|
117 | /** @name Compare Function */
|
---|
118 | //@{
|
---|
119 |
|
---|
120 | /**
|
---|
121 | * Compare two boolean data types
|
---|
122 | *
|
---|
123 | * @param content1
|
---|
124 | * @param content2
|
---|
125 | * @return
|
---|
126 | */
|
---|
127 | virtual int compare(const XMLCh* const, const XMLCh* const
|
---|
128 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
---|
129 |
|
---|
130 | //@}
|
---|
131 |
|
---|
132 | /**
|
---|
133 | * Returns an instance of the base datatype validator class
|
---|
134 | * Used by the DatatypeValidatorFactory.
|
---|
135 | */
|
---|
136 | virtual DatatypeValidator* newInstance
|
---|
137 | (
|
---|
138 | RefHashTableOf<KVStringPair>* const facets
|
---|
139 | , RefArrayVectorOf<XMLCh>* const enums
|
---|
140 | , const int finalSet
|
---|
141 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
142 | );
|
---|
143 |
|
---|
144 | /***
|
---|
145 | * Support for Serialization/De-serialization
|
---|
146 | ***/
|
---|
147 | DECL_XSERIALIZABLE(NameDatatypeValidator)
|
---|
148 |
|
---|
149 | protected:
|
---|
150 |
|
---|
151 | //
|
---|
152 | // ctor provided to be used by derived classes
|
---|
153 | //
|
---|
154 | NameDatatypeValidator
|
---|
155 | (
|
---|
156 | DatatypeValidator* const baseValidator
|
---|
157 | , RefHashTableOf<KVStringPair>* const facets
|
---|
158 | , const int finalSet
|
---|
159 | , const ValidatorType type
|
---|
160 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
161 | );
|
---|
162 |
|
---|
163 | virtual void checkValueSpace(const XMLCh* const content
|
---|
164 | , MemoryManager* const manager);
|
---|
165 |
|
---|
166 | private:
|
---|
167 | // -----------------------------------------------------------------------
|
---|
168 | // Unimplemented constructors and operators
|
---|
169 | // -----------------------------------------------------------------------
|
---|
170 | NameDatatypeValidator(const NameDatatypeValidator&);
|
---|
171 | NameDatatypeValidator& operator=(const NameDatatypeValidator&);
|
---|
172 | // -----------------------------------------------------------------------
|
---|
173 | // Private data members
|
---|
174 | //
|
---|
175 | //
|
---|
176 | // -----------------------------------------------------------------------
|
---|
177 |
|
---|
178 | };
|
---|
179 |
|
---|
180 | XERCES_CPP_NAMESPACE_END
|
---|
181 |
|
---|
182 | #endif
|
---|
183 |
|
---|
184 | /**
|
---|
185 | * End of file NameDatatypeValidator.hpp
|
---|
186 | */
|
---|
187 |
|
---|