Xalan-C++ API Reference  1.12.0
XNumber.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XNUMBER_HEADER_GUARD_1357924680)
19 #define XNUMBER_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base header file. Must be first.
25 
26 
27 
29 
30 
31 
32 // Base class header file.
34 
35 
36 
37 namespace XALAN_CPP_NAMESPACE {
38 
39 
40 
42 {
43 public:
44 
45  /**
46  * Create an XNumber from a number.
47  *
48  * @param val numeric value to use
49  */
51  double val,
52  MemoryManager& theMemoryManager);
53 
55  const XNumber& source,
56  MemoryManager& theMemoryManager);
57 
58  virtual
60 
61  // These methods are inherited from XObject ...
62 
63  virtual double
64  num(XPathExecutionContext& executionContext) const;
65 
66  virtual double
67  num() const;
68 
69  virtual const XalanDOMString&
70  str(XPathExecutionContext& executionContext) const;
71 
72  virtual const XalanDOMString&
73  str() const;
74 
75  virtual void
76  str(
77  XPathExecutionContext& executionContext,
78  FormatterListener& formatterListener,
79  MemberFunctionPtr function) const;
80 
81  virtual void
82  str(
83  FormatterListener& formatterListener,
84  MemberFunctionPtr function) const;
85 
86  virtual void
87  str(
88  XPathExecutionContext& executionContext,
89  XalanDOMString& theBuffer) const;
90 
91  virtual void
92  str(XalanDOMString& theBuffer) const;
93 
94  virtual double
95  stringLength(XPathExecutionContext& executionContext) const;
96 
97  // These methods are new to XNumber...
98 
99  /**
100  * Change the value of an XNumber
101  *
102  * @param theValue The new value.
103  */
104  void
105  set(double theValue);
106 
107 private:
108  // not implemented
109  XNumber();
110  XNumber(const XNumber&);
111 
112  // Value of the number being represented.
113  double m_value;
114 
115  mutable XalanDOMString m_cachedStringValue;
116 };
117 
118 
119 
120 }
121 
122 
123 
124 #endif // XNUMBER_HEADER_GUARD_1357924680
#define XALAN_XPATH_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
A SAX-based formatter interface for the XSL processor.
virtual void str(FormatterListener &formatterListener, MemberFunctionPtr function) const
Send the string value to a FormatterListener instance.
virtual const XalanDOMString & str(XPathExecutionContext &executionContext) const
Cast result object to a string.
void set(double theValue)
Change the value of an XNumber.
XNumber(const XNumber &source, MemoryManager &theMemoryManager)
virtual const XalanDOMString & str() const
Cast result object to a string.
virtual double stringLength(XPathExecutionContext &executionContext) const
Get the length of the string value of the instance.
virtual double num(XPathExecutionContext &executionContext) const
Cast result object to a number.
virtual ~XNumber()
virtual void str(XPathExecutionContext &executionContext, XalanDOMString &theBuffer) const
Append the string value directly a string.
virtual void str(XalanDOMString &theBuffer) const
Append the string value directly a string.
virtual double num() const
Cast result object to a number.
XNumber(double val, MemoryManager &theMemoryManager)
Create an XNumber from a number.
virtual void str(XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Send the string value to a FormatterListener instance.