[358] | 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: DoubleDatatypeValidator.hpp,v 1.9 2004/09/08 13:56:53 peiyongz Exp $
|
---|
| 19 | * $Log: DoubleDatatypeValidator.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:38 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/10/02 19:21:06 peiyongz
|
---|
| 33 | * Implementation of Serialization/Deserialization
|
---|
| 34 | *
|
---|
| 35 | * Revision 1.4 2003/05/15 18:53:26 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:41 peiyongz
|
---|
| 45 | * sane_include
|
---|
| 46 | *
|
---|
| 47 | * Revision 1.5 2001/10/09 20:52:43 peiyongz
|
---|
| 48 | * init():removed
|
---|
| 49 | *
|
---|
| 50 | * Revision 1.4 2001/10/01 21:03:55 peiyongz
|
---|
| 51 | * DTV Reorganization:derived from AbstractNumericValidator
|
---|
| 52 | *
|
---|
| 53 | * Revision 1.3 2001/08/24 17:12:01 knoaman
|
---|
| 54 | * Add support for anySimpleType.
|
---|
| 55 | * Remove parameter 'baseValidator' from the virtual method 'newInstance'.
|
---|
| 56 | *
|
---|
| 57 | * Revision 1.2 2001/08/21 18:42:53 peiyongz
|
---|
| 58 | * Bugzilla# 2816: cleanUp() declared with external linkage and called
|
---|
| 59 | * before defined as inline
|
---|
| 60 | *
|
---|
| 61 | * Revision 1.1 2001/07/24 13:59:03 peiyongz
|
---|
| 62 | * DoubleDTV
|
---|
| 63 | *
|
---|
| 64 | */
|
---|
| 65 |
|
---|
| 66 | #if !defined(DOUBLE_DATATYPEVALIDATOR_HPP)
|
---|
| 67 | #define DOUBLE_DATATYPEVALIDATOR_HPP
|
---|
| 68 |
|
---|
| 69 | #include <xercesc/validators/datatype/AbstractNumericValidator.hpp>
|
---|
| 70 | #include <xercesc/util/RefVectorOf.hpp>
|
---|
| 71 | #include <xercesc/util/XMLDouble.hpp>
|
---|
| 72 |
|
---|
| 73 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
| 74 |
|
---|
| 75 | class VALIDATORS_EXPORT DoubleDatatypeValidator : public AbstractNumericValidator
|
---|
| 76 | {
|
---|
| 77 | public:
|
---|
| 78 |
|
---|
| 79 | // -----------------------------------------------------------------------
|
---|
| 80 | // Public ctor/dtor
|
---|
| 81 | // -----------------------------------------------------------------------
|
---|
| 82 | /** @name Constructors and Destructor */
|
---|
| 83 | //@{
|
---|
| 84 |
|
---|
| 85 | DoubleDatatypeValidator
|
---|
| 86 | (
|
---|
| 87 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
| 88 | );
|
---|
| 89 | DoubleDatatypeValidator
|
---|
| 90 | (
|
---|
| 91 | DatatypeValidator* const baseValidator
|
---|
| 92 | , RefHashTableOf<KVStringPair>* const facets
|
---|
| 93 | , RefArrayVectorOf<XMLCh>* const enums
|
---|
| 94 | , const int finalSet
|
---|
| 95 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
| 96 | );
|
---|
| 97 | virtual ~DoubleDatatypeValidator();
|
---|
| 98 |
|
---|
| 99 | //@}
|
---|
| 100 |
|
---|
| 101 | // -----------------------------------------------------------------------
|
---|
| 102 | // Compare methods
|
---|
| 103 | // -----------------------------------------------------------------------
|
---|
| 104 | /** @name Compare Function */
|
---|
| 105 | //@{
|
---|
| 106 |
|
---|
| 107 | /**
|
---|
| 108 | * Compare two boolean data types
|
---|
| 109 | *
|
---|
| 110 | * @param content1
|
---|
| 111 | * @param content2
|
---|
| 112 | * @return
|
---|
| 113 | */
|
---|
| 114 | virtual int compare(const XMLCh* const, const XMLCh* const
|
---|
| 115 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
| 116 | );
|
---|
| 117 |
|
---|
| 118 | //@}
|
---|
| 119 |
|
---|
| 120 | /**
|
---|
| 121 | * Returns an instance of the base datatype validator class
|
---|
| 122 | * Used by the DatatypeValidatorFactory.
|
---|
| 123 | */
|
---|
| 124 | virtual DatatypeValidator* newInstance
|
---|
| 125 | (
|
---|
| 126 | RefHashTableOf<KVStringPair>* const facets
|
---|
| 127 | , RefArrayVectorOf<XMLCh>* const enums
|
---|
| 128 | , const int finalSet
|
---|
| 129 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
| 130 | );
|
---|
| 131 |
|
---|
| 132 | /***
|
---|
| 133 | * Support for Serialization/De-serialization
|
---|
| 134 | ***/
|
---|
| 135 | DECL_XSERIALIZABLE(DoubleDatatypeValidator)
|
---|
| 136 |
|
---|
| 137 | protected:
|
---|
| 138 |
|
---|
| 139 | // -----------------------------------------------------------------------
|
---|
| 140 | // ctor provided to be used by derived classes
|
---|
| 141 | // -----------------------------------------------------------------------
|
---|
| 142 | DoubleDatatypeValidator
|
---|
| 143 | (
|
---|
| 144 | DatatypeValidator* const baseValidator
|
---|
| 145 | , RefHashTableOf<KVStringPair>* const facets
|
---|
| 146 | , const int finalSet
|
---|
| 147 | , const ValidatorType type
|
---|
| 148 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
| 149 | );
|
---|
| 150 |
|
---|
| 151 | // -----------------------------------------------------------------------
|
---|
| 152 | // Abstract interface from AbstractNumericFacetValidator
|
---|
| 153 | // -----------------------------------------------------------------------
|
---|
| 154 |
|
---|
| 155 | virtual int compareValues(const XMLNumber* const lValue
|
---|
| 156 | , const XMLNumber* const rValue);
|
---|
| 157 |
|
---|
| 158 | virtual void setMaxInclusive(const XMLCh* const);
|
---|
| 159 |
|
---|
| 160 | virtual void setMaxExclusive(const XMLCh* const);
|
---|
| 161 |
|
---|
| 162 | virtual void setMinInclusive(const XMLCh* const);
|
---|
| 163 |
|
---|
| 164 | virtual void setMinExclusive(const XMLCh* const);
|
---|
| 165 |
|
---|
| 166 | virtual void setEnumeration(MemoryManager* const manager);
|
---|
| 167 |
|
---|
| 168 | // -----------------------------------------------------------------------
|
---|
| 169 | // Abstract interface from AbstractNumericValidator
|
---|
| 170 | // -----------------------------------------------------------------------
|
---|
| 171 |
|
---|
| 172 | virtual void checkContent(const XMLCh* const content
|
---|
| 173 | , ValidationContext* const context
|
---|
| 174 | , bool asBase
|
---|
| 175 | , MemoryManager* const manager);
|
---|
| 176 | private:
|
---|
| 177 | // -----------------------------------------------------------------------
|
---|
| 178 | // Unimplemented constructors and operators
|
---|
| 179 | // -----------------------------------------------------------------------
|
---|
| 180 | DoubleDatatypeValidator(const DoubleDatatypeValidator &);
|
---|
| 181 | DoubleDatatypeValidator& operator = (const DoubleDatatypeValidator&);
|
---|
| 182 | };
|
---|
| 183 |
|
---|
| 184 | XERCES_CPP_NAMESPACE_END
|
---|
| 185 |
|
---|
| 186 | #endif
|
---|
| 187 |
|
---|
| 188 | /**
|
---|
| 189 | * End of file DoubleDatatypeValidator.hpp
|
---|
| 190 | */
|
---|