[2674] | 1 | /* |
---|
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
| 3 | * contributor license agreements. See the NOTICE file distributed with |
---|
| 4 | * this work for additional information regarding copyright ownership. |
---|
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
| 6 | * (the "License"); you may not use this file except in compliance with |
---|
| 7 | * the License. You may obtain a copy of the License at |
---|
| 8 | * |
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 10 | * |
---|
| 11 | * Unless required by applicable law or agreed to in writing, software |
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 14 | * See the License for the specific language governing permissions and |
---|
| 15 | * limitations under the License. |
---|
| 16 | */ |
---|
| 17 | |
---|
| 18 | /* |
---|
| 19 | * $Id: FloatDatatypeValidator.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | #if !defined(FLOAT_DATATYPEVALIDATOR_HPP) |
---|
| 23 | #define FLOAT_DATATYPEVALIDATOR_HPP |
---|
| 24 | |
---|
| 25 | #include <xercesc/validators/datatype/AbstractNumericValidator.hpp> |
---|
| 26 | #include <xercesc/util/RefVectorOf.hpp> |
---|
| 27 | #include <xercesc/util/XMLFloat.hpp> |
---|
| 28 | |
---|
| 29 | XERCES_CPP_NAMESPACE_BEGIN |
---|
| 30 | |
---|
| 31 | class VALIDATORS_EXPORT FloatDatatypeValidator : public AbstractNumericValidator |
---|
| 32 | { |
---|
| 33 | public: |
---|
| 34 | |
---|
| 35 | // ----------------------------------------------------------------------- |
---|
| 36 | // Public ctor/dtor |
---|
| 37 | // ----------------------------------------------------------------------- |
---|
| 38 | /** @name Constructors and Destructor */ |
---|
| 39 | //@{ |
---|
| 40 | FloatDatatypeValidator |
---|
| 41 | ( |
---|
| 42 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
| 43 | ); |
---|
| 44 | FloatDatatypeValidator |
---|
| 45 | ( |
---|
| 46 | DatatypeValidator* const baseValidator |
---|
| 47 | , RefHashTableOf<KVStringPair>* const facets |
---|
| 48 | , RefArrayVectorOf<XMLCh>* const enums |
---|
| 49 | , const int finalSet |
---|
| 50 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
| 51 | ); |
---|
| 52 | virtual ~FloatDatatypeValidator(); |
---|
| 53 | |
---|
| 54 | //@} |
---|
| 55 | |
---|
| 56 | // ----------------------------------------------------------------------- |
---|
| 57 | // Compare methods |
---|
| 58 | // ----------------------------------------------------------------------- |
---|
| 59 | /** @name Compare Function */ |
---|
| 60 | //@{ |
---|
| 61 | |
---|
| 62 | /** |
---|
| 63 | * Compare two boolean data types |
---|
| 64 | * |
---|
| 65 | * @param content1 |
---|
| 66 | * @param content2 |
---|
| 67 | * @return |
---|
| 68 | */ |
---|
| 69 | virtual int compare(const XMLCh* const, const XMLCh* const |
---|
| 70 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
| 71 | ); |
---|
| 72 | |
---|
| 73 | //@} |
---|
| 74 | |
---|
| 75 | /** |
---|
| 76 | * Returns an instance of the base datatype validator class |
---|
| 77 | * Used by the DatatypeValidatorFactory. |
---|
| 78 | */ |
---|
| 79 | virtual DatatypeValidator* newInstance |
---|
| 80 | ( |
---|
| 81 | RefHashTableOf<KVStringPair>* const facets |
---|
| 82 | , RefArrayVectorOf<XMLCh>* const enums |
---|
| 83 | , const int finalSet |
---|
| 84 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
| 85 | ); |
---|
| 86 | |
---|
| 87 | /*** |
---|
| 88 | * Support for Serialization/De-serialization |
---|
| 89 | ***/ |
---|
| 90 | DECL_XSERIALIZABLE(FloatDatatypeValidator) |
---|
| 91 | |
---|
| 92 | protected: |
---|
| 93 | |
---|
| 94 | // ----------------------------------------------------------------------- |
---|
| 95 | // ctor provided to be used by derived classes |
---|
| 96 | // ----------------------------------------------------------------------- |
---|
| 97 | FloatDatatypeValidator |
---|
| 98 | ( |
---|
| 99 | DatatypeValidator* const baseValidator |
---|
| 100 | , RefHashTableOf<KVStringPair>* const facets |
---|
| 101 | , const int finalSet |
---|
| 102 | , const ValidatorType type |
---|
| 103 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
| 104 | ); |
---|
| 105 | |
---|
| 106 | // ----------------------------------------------------------------------- |
---|
| 107 | // Abstract interface from AbstractNumericFacetValidator |
---|
| 108 | // ----------------------------------------------------------------------- |
---|
| 109 | |
---|
| 110 | virtual int compareValues(const XMLNumber* const lValue |
---|
| 111 | , const XMLNumber* const rValue); |
---|
| 112 | |
---|
| 113 | virtual void setMaxInclusive(const XMLCh* const); |
---|
| 114 | |
---|
| 115 | virtual void setMaxExclusive(const XMLCh* const); |
---|
| 116 | |
---|
| 117 | virtual void setMinInclusive(const XMLCh* const); |
---|
| 118 | |
---|
| 119 | virtual void setMinExclusive(const XMLCh* const); |
---|
| 120 | |
---|
| 121 | virtual void setEnumeration(MemoryManager* const manager); |
---|
| 122 | |
---|
| 123 | // ----------------------------------------------------------------------- |
---|
| 124 | // Abstract interface from AbstractNumericValidator |
---|
| 125 | // ----------------------------------------------------------------------- |
---|
| 126 | |
---|
| 127 | virtual void checkContent(const XMLCh* const content |
---|
| 128 | , ValidationContext* const context |
---|
| 129 | , bool asBase |
---|
| 130 | , MemoryManager* const manager); |
---|
| 131 | private: |
---|
| 132 | // ----------------------------------------------------------------------- |
---|
| 133 | // Unimplemented constructors and operators |
---|
| 134 | // ----------------------------------------------------------------------- |
---|
| 135 | FloatDatatypeValidator(const FloatDatatypeValidator&); |
---|
| 136 | FloatDatatypeValidator& operator = (const FloatDatatypeValidator&); |
---|
| 137 | }; |
---|
| 138 | |
---|
| 139 | XERCES_CPP_NAMESPACE_END |
---|
| 140 | |
---|
| 141 | #endif |
---|
| 142 | |
---|
| 143 | /** |
---|
| 144 | * End of file FloatDatatypeValidator.hpp |
---|
| 145 | */ |
---|