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: TimeDatatypeValidator.hpp,v 1.11 2004/09/08 13:56:53 peiyongz Exp $
|
---|
19 | * $Log: TimeDatatypeValidator.hpp,v $
|
---|
20 | * Revision 1.11 2004/09/08 13:56:53 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:39 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/10/02 19:21:06 peiyongz
|
---|
37 | * Implementation of Serialization/Deserialization
|
---|
38 | *
|
---|
39 | * Revision 1.5 2003/08/14 03:00:11 knoaman
|
---|
40 | * Code refactoring to improve performance of validation.
|
---|
41 | *
|
---|
42 | * Revision 1.4 2003/05/15 18:53:27 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:28 tng
|
---|
49 | * C++ Namespace Support.
|
---|
50 | *
|
---|
51 | * Revision 1.1.1.1 2002/02/01 22:22:42 peiyongz
|
---|
52 | * sane_include
|
---|
53 | *
|
---|
54 | * Revision 1.1 2001/11/07 19:18:52 peiyongz
|
---|
55 | * DateTime Port
|
---|
56 | *
|
---|
57 | */
|
---|
58 |
|
---|
59 | #if !defined(TIME_DATATYPE_VALIDATOR_HPP)
|
---|
60 | #define TIME_DATATYPE_VALIDATOR_HPP
|
---|
61 |
|
---|
62 | #include <xercesc/validators/datatype/DateTimeValidator.hpp>
|
---|
63 | #include <xercesc/util/RefVectorOf.hpp>
|
---|
64 |
|
---|
65 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
66 |
|
---|
67 | class VALIDATORS_EXPORT TimeDatatypeValidator : public DateTimeValidator
|
---|
68 | {
|
---|
69 | public:
|
---|
70 |
|
---|
71 | // -----------------------------------------------------------------------
|
---|
72 | // Public ctor/dtor
|
---|
73 | // -----------------------------------------------------------------------
|
---|
74 | /** @name Constructors and Destructor */
|
---|
75 | //@{
|
---|
76 |
|
---|
77 | TimeDatatypeValidator
|
---|
78 | (
|
---|
79 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
80 | );
|
---|
81 | TimeDatatypeValidator
|
---|
82 | (
|
---|
83 | DatatypeValidator* const baseValidator
|
---|
84 | , RefHashTableOf<KVStringPair>* const facets
|
---|
85 | , RefArrayVectorOf<XMLCh>* const enums
|
---|
86 | , const int finalSet
|
---|
87 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
88 | );
|
---|
89 | ~TimeDatatypeValidator();
|
---|
90 |
|
---|
91 |
|
---|
92 | //@}
|
---|
93 |
|
---|
94 | /**
|
---|
95 | * Returns an instance of the base datatype validator class
|
---|
96 | * Used by the DatatypeValidatorFactory.
|
---|
97 | */
|
---|
98 | virtual DatatypeValidator* newInstance
|
---|
99 | (
|
---|
100 | RefHashTableOf<KVStringPair>* const facets
|
---|
101 | , RefArrayVectorOf<XMLCh>* const enums
|
---|
102 | , const int finalSet
|
---|
103 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
104 | );
|
---|
105 |
|
---|
106 | virtual const XMLCh* getCanonicalRepresentation
|
---|
107 | (
|
---|
108 | const XMLCh* const rawData
|
---|
109 | , MemoryManager* const memMgr = 0
|
---|
110 | , bool toValidate = false
|
---|
111 | ) const;
|
---|
112 |
|
---|
113 | /***
|
---|
114 | * Support for Serialization/De-serialization
|
---|
115 | ***/
|
---|
116 | DECL_XSERIALIZABLE(TimeDatatypeValidator)
|
---|
117 |
|
---|
118 | protected:
|
---|
119 |
|
---|
120 | // -----------------------------------------------------------------------
|
---|
121 | // implementation of (DateTimeValidator's) virtual interface
|
---|
122 | // -----------------------------------------------------------------------
|
---|
123 | virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager);
|
---|
124 | virtual void parse(XMLDateTime* const);
|
---|
125 |
|
---|
126 | private:
|
---|
127 | // -----------------------------------------------------------------------
|
---|
128 | // Unimplemented constructors and operators
|
---|
129 | // -----------------------------------------------------------------------
|
---|
130 | TimeDatatypeValidator(const TimeDatatypeValidator&);
|
---|
131 | TimeDatatypeValidator& operator=(const TimeDatatypeValidator&);
|
---|
132 | };
|
---|
133 |
|
---|
134 | XERCES_CPP_NAMESPACE_END
|
---|
135 |
|
---|
136 | #endif
|
---|
137 |
|
---|
138 | /**
|
---|
139 | * End of file TimeDatatypeValidator.hpp
|
---|
140 | */
|
---|
141 |
|
---|