Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XalanNumberFormat.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(XALANNUMBERFORMAT_HEADER_GUARD_1357924680)
19 #define XALANNUMBERFORMAT_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
32 XALAN_CPP_NAMESPACE_BEGIN
33 
34 
35 
37 {
38 public:
39 
40  explicit
41  XalanNumberFormat(MemoryManager& theManager);
42 
43  static XalanNumberFormat*
44  create(MemoryManager& theManager)
45  {
46  XalanNumberFormat* theInstance;
47 
48  return XalanConstruct(
49  theManager,
50  theInstance,
51  theManager);
52  }
53 
54  virtual
56 
57  MemoryManager&
59  {
60  return m_groupingSeparator.getMemoryManager();
61  }
62 
63  /**
64  * Format a number into a string.
65  *
66  * @param theValue number to format
67  * @return string representation of number
68  */
69  virtual XalanDOMString&
70  format(double theValue,
71  XalanDOMString& theResult);
72 
73 
74 
75  /**
76  * Format a number into a string.
77  *
78  * @param theValue number to format
79  * @return string representation of number
80  */
81  virtual XalanDOMString&
82  format(int theValue,
83  XalanDOMString& theResult);
84 
85 
86 
87  /**
88  * Format a number into a string.
89  *
90  * @param theValue number to format
91  * @param theResult the string result
92  */
93  virtual XalanDOMString&
94  format(
95  unsigned int theValue,
96  XalanDOMString& theResult);
97 
98  /**
99  * Format a number into a string.
100  *
101  * @param theValue number to format
102  * @return string representation of number
103  */
104  virtual XalanDOMString&
105  format(long theValue,
106  XalanDOMString& theResult);
107 
108 
109  /**
110  * Format a number into a string.
111  *
112  * @param theValue number to format
113  * @param theResult the string result
114  */
115  virtual XalanDOMString&
116  format(
117  unsigned long theValue,
118  XalanDOMString& theResult);
119 
120  /**
121  * Format a number into a string.
122  *
123  * @param theValue number to format
124  * @param theResult the string result
125  */
126  virtual XalanDOMString&
127  format(
128  XALAN_INT64 theValue,
129  XalanDOMString& theResult);
130 
131  /**
132  * Format a number into a string.
133  *
134  * @param theValue number to format
135  * @param theResult the string result
136  */
137  virtual XalanDOMString&
138  format(
139  XALAN_UINT64 theValue,
140  XalanDOMString& theResult);
141 
142  /**
143  * Whether groupings are used for numbers, for example, "234,678"
144  *
145  * @return true if grouping used
146  */
147  virtual bool
148  isGroupingUsed() const;
149 
150  /**
151  * Change whether groupings are used for numbers, for example, "234,678"
152  *
153  * @param bUsed true to use grouping
154  */
155  virtual void
156  setGroupingUsed(bool bUsed);
157 
158  /**
159  * Change the size of groupings, for example, "234,678" uses a size of "3"
160  *
161  * @param size the grouping size
162  */
163  virtual void
164  setGroupingSize(unsigned long size);
165 
166  /**
167  * Change the separator string used for groupings, for example, "234,678"
168  * uses the separator ","
169  *
170  * @param s grouping separator string
171  */
172  virtual void
173  setGroupingSeparator(const XalanDOMString& s);
174 
175 protected:
176 
177  void
178  applyGrouping(
179  const XalanDOMString& value,
180  XalanDOMString& result);
181 
182 private:
183 
184  // Not implemented...
186 
188  operator=(const XalanNumberFormat&);
189 
190  bool
192 
193  // Data members...
194  bool m_isGroupingUsed;
195 
196  XalanDOMString m_groupingSeparator;
197 
198  unsigned long m_groupingSize;
199 
200  static const XalanDOMChar s_defaultGroupingSeparator[];
201 };
202 
203 
204 
205 XALAN_CPP_NAMESPACE_END
206 
207 
208 
209 #endif // XALANNUMBERFORMAT_HEADER_GUARD_1357924680
UINT64 XALAN_UINT64
INT64 XALAN_INT64
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
#define XALAN_PLATFORMSUPPORT_EXPORT
Type * XalanConstruct(MemoryManager &theMemoryManager, Type *&theInstance)
MemoryManager & getMemoryManager()
static XalanNumberFormat * create(MemoryManager &theManager)

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo