source: icXML/icXML-devel/src/xercesc/util/XMLNumber.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 2.8 KB
Line 
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: XMLNumber.hpp 527149 2007-04-10 14:56:39Z amassari $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_XMLNUMBER_HPP)
23#define XERCESC_INCLUDE_GUARD_XMLNUMBER_HPP
24
25#include <xercesc/internal/XSerializable.hpp>
26#include <xercesc/util/XMemory.hpp>
27
28XERCES_CPP_NAMESPACE_BEGIN
29
30class XMLUTIL_EXPORT XMLNumber : public XSerializable, public XMemory
31{
32public:
33
34    enum
35    {
36        LESS_THAN     = -1,
37        EQUAL         = 0,
38        GREATER_THAN  = 1,
39        INDETERMINATE = 2
40    };
41
42    enum NumberType {
43        Float,
44        Double,
45        BigDecimal,
46        DateTime,
47        UnKnown
48    };
49
50    virtual ~XMLNumber();
51   
52        /**
53         *  Return string representation of the decimal value.
54     *  A decimal point will be included as necessary.
55     *  Similar to toString above, but the internal buffer is
56     *  returned directly, user is not required to delete
57     *  the returned buffer
58         */
59    virtual XMLCh*     getRawData() const = 0;   
60
61    /**
62     *  Return the original and converted value of the original data.
63     *  (applicable to double/float)
64     *
65     *  The internal buffer is returned directly, user is not required
66     *  to delete the returned buffer
67     */
68    virtual const XMLCh*     getFormattedString() const = 0;   
69
70        /**
71         * Returns the sign of this number
72     *
73     * -1   negative
74     *  0   zero
75     *  1   positive
76         *
77         */
78    virtual int        getSign() const = 0;
79
80    /***
81     * Support for Serialization/De-serialization
82     ***/
83    DECL_XSERIALIZABLE(XMLNumber)
84
85    static XMLNumber*          loadNumber(XMLNumber::NumberType   numType
86                                        , XSerializeEngine&       serEng);
87
88protected:
89
90    XMLNumber();
91    XMLNumber(const XMLNumber&);
92
93private:
94    // -----------------------------------------------------------------------
95    //  Unimplemented operators
96    // -----------------------------------------------------------------------
97    XMLNumber& operator=(const XMLNumber&);
98};
99
100XERCES_CPP_NAMESPACE_END
101
102#endif
Note: See TracBrowser for help on using the repository browser.