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: AbstractNumericValidator.hpp,v 1.11 2004/09/08 13:56:52 peiyongz Exp $
|
---|
19 | * $Log: AbstractNumericValidator.hpp,v $
|
---|
20 | * Revision 1.11 2004/09/08 13:56:52 peiyongz
|
---|
21 | * Apache License Version 2.0
|
---|
22 | *
|
---|
23 | * Revision 1.10 2004/01/29 11:51:22 cargilld
|
---|
24 | * Code cleanup changes to get rid of various compiler diagnostic messages.
|
---|
25 | *
|
---|
26 | * Revision 1.9 2003/12/23 21:50:36 peiyongz
|
---|
27 | * Absorb exception thrown in getCanonicalRepresentation and return 0,
|
---|
28 | * only validate when required
|
---|
29 | *
|
---|
30 | * Revision 1.8 2003/12/17 00:18:38 cargilld
|
---|
31 | * Update to memory management so that the static memory manager (one used to call Initialize) is only for static data.
|
---|
32 | *
|
---|
33 | * Revision 1.7 2003/11/28 18:53:07 peiyongz
|
---|
34 | * Support for getCanonicalRepresentation
|
---|
35 | *
|
---|
36 | * Revision 1.6 2003/11/12 20:32:03 peiyongz
|
---|
37 | * Statless Grammar: ValidationContext
|
---|
38 | *
|
---|
39 | * Revision 1.5 2003/10/02 19:21:06 peiyongz
|
---|
40 | * Implementation of Serialization/Deserialization
|
---|
41 | *
|
---|
42 | * Revision 1.4 2003/05/15 18:53:26 knoaman
|
---|
43 | * Partial implementation of the configurable memory manager.
|
---|
44 | *
|
---|
45 | * Revision 1.3 2002/12/18 14:17:55 gareth
|
---|
46 | * Fix to bug #13438. When you eant a vector that calls delete[] on its members you should use RefArrayVectorOf.
|
---|
47 | *
|
---|
48 | * Revision 1.2 2002/11/04 14:53:27 tng
|
---|
49 | * C++ Namespace Support.
|
---|
50 | *
|
---|
51 | * Revision 1.1.1.1 2002/02/01 22:22:39 peiyongz
|
---|
52 | * sane_include
|
---|
53 | *
|
---|
54 | * Revision 1.2 2001/11/22 20:23:20 peiyongz
|
---|
55 | * _declspec(dllimport) and inline warning C4273
|
---|
56 | *
|
---|
57 | * Revision 1.1 2001/10/01 16:13:56 peiyongz
|
---|
58 | * DTV Reorganization:new classes: AbstractNumericFactValidator/ AbstractNumericValidator
|
---|
59 | *
|
---|
60 | */
|
---|
61 |
|
---|
62 | #if !defined(ABSTRACT_NUMERIC_VALIDATOR_HPP)
|
---|
63 | #define ABSTRACT_NUMERIC_VALIDATOR_HPP
|
---|
64 |
|
---|
65 | #include <xercesc/validators/datatype/AbstractNumericFacetValidator.hpp>
|
---|
66 | #include <xercesc/util/RefVectorOf.hpp>
|
---|
67 |
|
---|
68 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
69 |
|
---|
70 | class VALIDATORS_EXPORT AbstractNumericValidator : public AbstractNumericFacetValidator
|
---|
71 | {
|
---|
72 | public:
|
---|
73 |
|
---|
74 | // -----------------------------------------------------------------------
|
---|
75 | // Public ctor/dtor
|
---|
76 | // -----------------------------------------------------------------------
|
---|
77 | /** @name Constructor. */
|
---|
78 | //@{
|
---|
79 |
|
---|
80 | virtual ~AbstractNumericValidator();
|
---|
81 |
|
---|
82 | //@}
|
---|
83 |
|
---|
84 | virtual void validate
|
---|
85 | (
|
---|
86 | const XMLCh* const content
|
---|
87 | , ValidationContext* const context = 0
|
---|
88 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
89 | );
|
---|
90 |
|
---|
91 | virtual const XMLCh* getCanonicalRepresentation
|
---|
92 | (
|
---|
93 | const XMLCh* const rawData
|
---|
94 | , MemoryManager* const memMgr = 0
|
---|
95 | , bool toValidate = false
|
---|
96 | ) const;
|
---|
97 |
|
---|
98 | /***
|
---|
99 | * Support for Serialization/De-serialization
|
---|
100 | ***/
|
---|
101 | DECL_XSERIALIZABLE(AbstractNumericValidator)
|
---|
102 |
|
---|
103 | protected:
|
---|
104 |
|
---|
105 | AbstractNumericValidator
|
---|
106 | (
|
---|
107 | DatatypeValidator* const baseValidator
|
---|
108 | , RefHashTableOf<KVStringPair>* const facets
|
---|
109 | , const int finalSet
|
---|
110 | , const ValidatorType type
|
---|
111 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
112 | );
|
---|
113 |
|
---|
114 | inline void init(RefArrayVectorOf<XMLCh>* const enums
|
---|
115 | , MemoryManager* const manager);
|
---|
116 |
|
---|
117 | //
|
---|
118 | // Abstract interface
|
---|
119 | //
|
---|
120 | virtual void checkContent(const XMLCh* const content
|
---|
121 | , ValidationContext* const context
|
---|
122 | , bool asBase
|
---|
123 | , MemoryManager* const manager) = 0;
|
---|
124 |
|
---|
125 | void boundsCheck(const XMLNumber* const
|
---|
126 | , MemoryManager* const manager);
|
---|
127 |
|
---|
128 | private:
|
---|
129 |
|
---|
130 | // -----------------------------------------------------------------------
|
---|
131 | // Unimplemented constructors and operators
|
---|
132 | // -----------------------------------------------------------------------
|
---|
133 | AbstractNumericValidator(const AbstractNumericValidator&);
|
---|
134 | AbstractNumericValidator& operator=(const AbstractNumericValidator&);
|
---|
135 | };
|
---|
136 |
|
---|
137 | inline void AbstractNumericValidator::init(RefArrayVectorOf<XMLCh>* const enums
|
---|
138 | , MemoryManager* const manager)
|
---|
139 | {
|
---|
140 | AbstractNumericFacetValidator::init(enums, manager);
|
---|
141 | }
|
---|
142 |
|
---|
143 | XERCES_CPP_NAMESPACE_END
|
---|
144 |
|
---|
145 | #endif
|
---|
146 |
|
---|
147 | /**
|
---|
148 | * End of file AbstractNumericValidator.hpp
|
---|
149 | */
|
---|