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