Xalan-C++ API Reference  1.12.0
XalanDecimalFormatSymbols.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(XALANDECIMALFORMATSYMBOLS_HEADER_GUARD_1357924680)
19 #define XALANDECIMALFORMATSYMBOLS_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
28 #include <cassert>
29 
30 
31 
33 
34 
35 
36 namespace XALAN_CPP_NAMESPACE {
37 
38 
39 
41 {
42 public:
43 
44  // Eventually, this constructor should take a locale to determine
45  // all of the stuff it needs to know. But locales are implemented
46  // on all of our platforms yet.
47  explicit
48  XalanDecimalFormatSymbols(MemoryManager& theManager);
49 
51  MemoryManager& theManager);
52 
54 
56  operator=(const XalanDecimalFormatSymbols& theRHS);
57 
58  /**
59  * Retrieve the string denoting the local currency, "$", for example
60  *
61  * @return string used for local currency
62  */
63  const XalanDOMString&
65  {
66  return m_currencySymbol;
67  }
68 
69  /**
70  * Retrieve the character used for decimal sign, '.' for example
71  *
72  * @return character used for decimal sign
73  */
74  XalanDOMChar
76  {
77  return m_decimalSeparator;
78  }
79 
80  /**
81  * Retrieve character used for a digit in a pattern
82  *
83  * @return character used for a digit in a pattern
84  */
85  XalanDOMChar
86  getDigit() const
87  {
88  return m_digit;
89  }
90 
91  /**
92  * Retrieve the character used for thousands separator, "," for example
93  *
94  * @return character used for thousands separator
95  */
96  XalanDOMChar
98  {
99  return m_groupingSeparator;
100  }
101 
102  /**
103  * Retrieve the string used to represent infinity
104  *
105  * @return string used to represent infinity
106  */
107  const XalanDOMString&
108  getInfinity() const
109  {
110  return m_infinity;
111  }
112 
113  /**
114  * Retrieve the international string denoting the local currency
115  *
116  * @return international string denoting the local currency
117  */
118  const XalanDOMString&
120  {
121  return m_internationalCurrencySymbol;
122  }
123 
124  /**
125  * Retrieve the character used to represent minus sign
126  *
127  * @return character used to represent minus sign
128  */
129  XalanDOMChar
130  getMinusSign() const
131  {
132  return m_minusSign;
133  }
134 
135  /**
136  * Retrieve the monetary decimal separator
137  *
138  * @return character used to separate decimal portion of currency
139  */
140  XalanDOMChar
142  {
143  return m_monetaryDecimalSeparator;
144  }
145 
146  /**
147  * Retrieve the string used for a numeric value that cannot be represented
148  * as a number
149  *
150  * @return string representing "not a number" value
151  */
152  const XalanDOMString&
153  getNaN() const
154  {
155  return m_NaN;
156  }
157 
158  /**
159  * Retrieve the character used to separate positive and negative
160  * subpatterns in a pattern
161  *
162  * @return character used to separate positive and negative subpatterns
163  */
164  XalanDOMChar
166  {
167  return m_patternSeparator;
168  }
169 
170  /**
171  * Retrieve the character used for percent sign, "%," for example
172  *
173  * @return character used for percent sign
174  */
175  XalanDOMChar
176  getPercent() const
177  {
178  return m_percent;
179  }
180 
181  /**
182  * Retrieve the character used for per thousand sign
183  *
184  * @return character used for per thousand sign
185  */
186  XalanDOMChar
187  getPerMill() const
188  {
189  return m_perMill;
190  }
191 
192  /**
193  * Retrieve the character used for zero
194  *
195  * @return character used for zero
196  */
197  XalanDOMChar
198  getZeroDigit() const
199  {
200  return m_zeroDigit;
201  }
202 
203  /**
204  * Sets the string denoting the local currency, "$", for example
205  *
206  * @param theCurrencySymbol symbol used for local currency
207  */
208  void
209  setCurrencySymbol(const XalanDOMString& theCurrencySymbol)
210  {
211  m_currencySymbol = theCurrencySymbol;
212  }
213 
214  /**
215  * Sets the string denoting the local currency, "$", for example
216  *
217  * @param theCurrencySymbol symbol used for local currency
218  */
219  void
220  setCurrencySymbol(const XalanDOMChar* theCurrencySymbol)
221  {
222  assert(theCurrencySymbol != 0);
223 
224  m_currencySymbol = theCurrencySymbol;
225  }
226 
227  /**
228  * Sets the character used for decimal sign, '.' for example
229  *
230  * @param theDecimalSeparator character used for decimal sign
231  */
232  void
233  setDecimalSeparator(XalanDOMChar theDecimalSeparator)
234  {
235  m_decimalSeparator = theDecimalSeparator;
236  }
237 
238  /**
239  * Sets the character used for a digit in a pattern
240  *
241  * @param theDigit character used for a digit in a pattern
242  */
243  void
244  setDigit(XalanDOMChar theDigit)
245  {
246  m_digit = theDigit;
247  }
248 
249  /**
250  * Sets the character used for thousands separator, "," for example
251  *
252  * @param theGroupingSeparator character used for thousands separator
253  */
254  void
255  setGroupingSeparator(XalanDOMChar theGroupingSeparator)
256  {
257  m_groupingSeparator = theGroupingSeparator;
258  }
259 
260  /**
261  * Sets the string used to represent infinity
262  *
263  * @param theInfinity string used to represent infinity
264  */
265  void
266  setInfinity(const XalanDOMString& theInfinity)
267  {
268  m_infinity = theInfinity;
269  }
270 
271  /**
272  * Sets the string used to represent infinity
273  *
274  * @param theInfinity string used to represent infinity
275  */
276  void
277  setInfinity(const XalanDOMChar* theInfinity)
278  {
279  assert(theInfinity != 0);
280 
281  m_infinity = theInfinity;
282  }
283 
284  /**
285  * Sets the international string denoting the local currency
286  *
287  * @param theInternationalCurrencySymbol international string denoting the
288  * local currency
289  */
290  void
291  setInternationalCurrencySymbol(const XalanDOMString& theInternationalCurrencySymbol)
292  {
293  m_internationalCurrencySymbol = theInternationalCurrencySymbol;
294  }
295 
296  /**
297  * Sets the international string denoting the local currency
298  *
299  * @param theInternationalCurrencySymbol international string denoting the
300  * local currency
301  */
302  void
303  setInternationalCurrencySymbol(const XalanDOMChar* theInternationalCurrencySymbol)
304  {
305  assert(theInternationalCurrencySymbol != 0);
306 
307  m_internationalCurrencySymbol = theInternationalCurrencySymbol;
308  }
309 
310  /**
311  * Sets the character used to represent minus sign
312  *
313  * @param theMinusSign character used to represent minus sign
314  */
315  void
316  setMinusSign(XalanDOMChar theMinusSign)
317  {
318  m_minusSign = theMinusSign;
319  }
320 
321  /**
322  * Sets the monetary decimal separator
323  *
324  * @param theMonetaryDecimalSeparator character used to separate decimal
325  * portion of currency
326  */
327  void
328  setMonetaryDecimalSeparator(XalanDOMChar theMonetaryDecimalSeparator)
329  {
330  m_monetaryDecimalSeparator = theMonetaryDecimalSeparator;
331  }
332 
333  /**
334  * Sets the string used for a numeric value that cannot be represented
335  * as a number
336  *
337  * @param theNaN string representing "not a number" value
338  */
339  void
340  setNaN(const XalanDOMString& theNaN)
341  {
342  m_NaN = theNaN;
343  }
344 
345  /**
346  * Sets the string used for a numeric value that cannot be represented
347  * as a number
348  *
349  * @param theNaN string representing "not a number" value
350  */
351  void
352  setNaN(const XalanDOMChar* theNaN)
353  {
354  assert(theNaN != 0);
355 
356  m_NaN = theNaN;
357  }
358 
359  /**
360  * Sets the character used to separate positive and negative subpatterns in
361  * a pattern
362  *
363  * @param thePatternSeparator character used to separate positive and
364  * negative subpatterns
365  */
366  void
367  setPatternSeparator(XalanDOMChar thePatternSeparator)
368  {
369  m_patternSeparator = thePatternSeparator;
370  }
371 
372  /**
373  * Sets the character used for percent sign, "%," for example
374  *
375  * @param thePercent character used for percent sign
376  */
377  void
378  setPercent(XalanDOMChar thePercent)
379  {
380  m_percent = thePercent;
381  }
382 
383  /**
384  * Sets the character used for per thousand sign
385  *
386  * @param thePerMill character used for per thousand sign
387  */
388  void
389  setPerMill(XalanDOMChar thePerMill)
390  {
391  m_perMill = thePerMill;
392  }
393 
394  /**
395  * Sets the character used for zero
396  *
397  * @param theZeroDigit character used for zero
398  */
399  void
400  setZeroDigit(XalanDOMChar theZeroDigit)
401  {
402  m_zeroDigit = theZeroDigit;
403  }
404 
405  bool
406  operator==(const XalanDecimalFormatSymbols& theRHS) const;
407 
408  bool
410  {
411  return !operator==(theRHS);
412  }
413 
414 private:
415  // not implemented
418 
419  XalanDOMString m_currencySymbol;
420 
421  XalanDOMChar m_decimalSeparator;
422  XalanDOMChar m_digit;
423  XalanDOMChar m_groupingSeparator;
424 
425  XalanDOMString m_infinity;
426  XalanDOMString m_internationalCurrencySymbol;
427 
428  XalanDOMChar m_minusSign;
429  XalanDOMChar m_monetaryDecimalSeparator;
430 
431  XalanDOMString m_NaN;
432 
433  XalanDOMChar m_patternSeparator;
434  XalanDOMChar m_percent;
435  XalanDOMChar m_perMill;
436  XalanDOMChar m_zeroDigit;
437 };
438 
439 
440 
441 }
442 
443 
444 
445 #endif // XALANDECIMALFORMATSYMBOLS_HEADER_GUARD_1357924680
xalanc::XalanDecimalFormatSymbols::setNaN
void setNaN(const XalanDOMChar *theNaN)
Sets the string used for a numeric value that cannot be represented as a number.
Definition: XalanDecimalFormatSymbols.hpp:352
xalanc::XalanDecimalFormatSymbols::setCurrencySymbol
void setCurrencySymbol(const XalanDOMChar *theCurrencySymbol)
Sets the string denoting the local currency, "$", for example.
Definition: XalanDecimalFormatSymbols.hpp:220
xalanc::XalanDecimalFormatSymbols::setPatternSeparator
void setPatternSeparator(XalanDOMChar thePatternSeparator)
Sets the character used to separate positive and negative subpatterns in a pattern.
Definition: XalanDecimalFormatSymbols.hpp:367
xalanc::XalanDecimalFormatSymbols::setDigit
void setDigit(XalanDOMChar theDigit)
Sets the character used for a digit in a pattern.
Definition: XalanDecimalFormatSymbols.hpp:244
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanDecimalFormatSymbols::getInfinity
const XalanDOMString & getInfinity() const
Retrieve the string used to represent infinity.
Definition: XalanDecimalFormatSymbols.hpp:108
xalanc::XalanDecimalFormatSymbols::operator!=
bool operator!=(const XalanDecimalFormatSymbols &theRHS) const
Definition: XalanDecimalFormatSymbols.hpp:409
XalanDOMString.hpp
xalanc::XalanDecimalFormatSymbols
Definition: XalanDecimalFormatSymbols.hpp:40
xalanc::XalanDecimalFormatSymbols::setCurrencySymbol
void setCurrencySymbol(const XalanDOMString &theCurrencySymbol)
Sets the string denoting the local currency, "$", for example.
Definition: XalanDecimalFormatSymbols.hpp:209
xalanc::XalanDecimalFormatSymbols::getGroupingSeparator
XalanDOMChar getGroupingSeparator() const
Retrieve the character used for thousands separator, "," for example.
Definition: XalanDecimalFormatSymbols.hpp:97
xalanc::operator==
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1118
xalanc::XalanDecimalFormatSymbols::getDecimalSeparator
XalanDOMChar getDecimalSeparator() const
Retrieve the character used for decimal sign, '.
Definition: XalanDecimalFormatSymbols.hpp:75
xalanc::XalanDecimalFormatSymbols::getNaN
const XalanDOMString & getNaN() const
Retrieve the string used for a numeric value that cannot be represented as a number.
Definition: XalanDecimalFormatSymbols.hpp:153
xalanc::XalanDecimalFormatSymbols::getMinusSign
XalanDOMChar getMinusSign() const
Retrieve the character used to represent minus sign.
Definition: XalanDecimalFormatSymbols.hpp:130
XALAN_PLATFORMSUPPORT_EXPORT
#define XALAN_PLATFORMSUPPORT_EXPORT
Definition: PlatformSupportDefinitions.hpp:35
PlatformSupportDefinitions.hpp
xalanc::XalanDecimalFormatSymbols::getMonetaryDecimalSeparator
XalanDOMChar getMonetaryDecimalSeparator() const
Retrieve the monetary decimal separator.
Definition: XalanDecimalFormatSymbols.hpp:141
xalanc::XalanDecimalFormatSymbols::getDigit
XalanDOMChar getDigit() const
Retrieve character used for a digit in a pattern.
Definition: XalanDecimalFormatSymbols.hpp:86
xalanc::XalanDecimalFormatSymbols::setZeroDigit
void setZeroDigit(XalanDOMChar theZeroDigit)
Sets the character used for zero.
Definition: XalanDecimalFormatSymbols.hpp:400
xalanc::XalanDecimalFormatSymbols::setGroupingSeparator
void setGroupingSeparator(XalanDOMChar theGroupingSeparator)
Sets the character used for thousands separator, "," for example.
Definition: XalanDecimalFormatSymbols.hpp:255
xalanc::XalanDecimalFormatSymbols::getZeroDigit
XalanDOMChar getZeroDigit() const
Retrieve the character used for zero.
Definition: XalanDecimalFormatSymbols.hpp:198
xalanc::XalanDecimalFormatSymbols::getInternationalCurrencySymbol
const XalanDOMString & getInternationalCurrencySymbol() const
Retrieve the international string denoting the local currency.
Definition: XalanDecimalFormatSymbols.hpp:119
xalanc::XalanDecimalFormatSymbols::setMonetaryDecimalSeparator
void setMonetaryDecimalSeparator(XalanDOMChar theMonetaryDecimalSeparator)
Sets the monetary decimal separator.
Definition: XalanDecimalFormatSymbols.hpp:328
xalanc::XalanDecimalFormatSymbols::getCurrencySymbol
const XalanDOMString & getCurrencySymbol() const
Retrieve the string denoting the local currency, "$", for example.
Definition: XalanDecimalFormatSymbols.hpp:64
xalanc::XalanDecimalFormatSymbols::getPercent
XalanDOMChar getPercent() const
Retrieve the character used for percent sign, "%," for example.
Definition: XalanDecimalFormatSymbols.hpp:176
xalanc::XalanDecimalFormatSymbols::getPerMill
XalanDOMChar getPerMill() const
Retrieve the character used for per thousand sign.
Definition: XalanDecimalFormatSymbols.hpp:187
xalanc::XalanDecimalFormatSymbols::getPatternSeparator
XalanDOMChar getPatternSeparator() const
Retrieve the character used to separate positive and negative subpatterns in a pattern.
Definition: XalanDecimalFormatSymbols.hpp:165
xalanc::XalanDecimalFormatSymbols::setInternationalCurrencySymbol
void setInternationalCurrencySymbol(const XalanDOMString &theInternationalCurrencySymbol)
Sets the international string denoting the local currency.
Definition: XalanDecimalFormatSymbols.hpp:291
xalanc::XalanDecimalFormatSymbols::setPercent
void setPercent(XalanDOMChar thePercent)
Sets the character used for percent sign, "%," for example.
Definition: XalanDecimalFormatSymbols.hpp:378
xalanc::XalanDecimalFormatSymbols::setInfinity
void setInfinity(const XalanDOMChar *theInfinity)
Sets the string used to represent infinity.
Definition: XalanDecimalFormatSymbols.hpp:277
xalanc::XalanDecimalFormatSymbols::setPerMill
void setPerMill(XalanDOMChar thePerMill)
Sets the character used for per thousand sign.
Definition: XalanDecimalFormatSymbols.hpp:389
xalanc::XalanDecimalFormatSymbols::setNaN
void setNaN(const XalanDOMString &theNaN)
Sets the string used for a numeric value that cannot be represented as a number.
Definition: XalanDecimalFormatSymbols.hpp:340
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
xalanc::XalanDecimalFormatSymbols::setInternationalCurrencySymbol
void setInternationalCurrencySymbol(const XalanDOMChar *theInternationalCurrencySymbol)
Sets the international string denoting the local currency.
Definition: XalanDecimalFormatSymbols.hpp:303
xalanc::XalanDecimalFormatSymbols::setMinusSign
void setMinusSign(XalanDOMChar theMinusSign)
Sets the character used to represent minus sign.
Definition: XalanDecimalFormatSymbols.hpp:316
xalanc::XalanDecimalFormatSymbols::setInfinity
void setInfinity(const XalanDOMString &theInfinity)
Sets the string used to represent infinity.
Definition: XalanDecimalFormatSymbols.hpp:266
xalanc::XalanDecimalFormatSymbols::setDecimalSeparator
void setDecimalSeparator(XalanDOMChar theDecimalSeparator)
Sets the character used for decimal sign, '.
Definition: XalanDecimalFormatSymbols.hpp:233