ICU 58.2 58.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Types | Public Member Functions | Static Public Member Functions
icu::Formattable Class Reference

Formattable objects can be passed to the Format class or its subclasses for formatting. More...

`#include <fmtable.h>`

Inheritance diagram for icu::Formattable:

## Public Types
enum | ISDATE { kIsDate }
| This enum is only used to let callers distinguish between the Formattable(UDate) constructor and the Formattable(double) constructor; the compiler cannot distinguish the signatures, since UDate is currently typedefed to be either double or long. More...
enum | Type { kDate, kDouble, kLong, kString, kArray, kInt64, kObject }
| Selector for flavor of data type contained within a Formattable object. More...

## Public Member Functions
| Formattable ()
| Default constructor. More...
| Formattable (UDate d, ISDATE flag)
| Creates a Formattable object with a UDate instance. More...
| Formattable (double d)
| Creates a Formattable object with a double number. More...
| Formattable (int32_t l)
| Creates a Formattable object with a long number. More...
| Formattable (int64_t ll)
| Creates a Formattable object with an int64_t number. More...
| Formattable (const char *strToCopy)
| Creates a Formattable object with a char string pointer. More...
| Formattable (StringPiece number, UErrorCode &status)
| Creates a Formattable object of an appropriate numeric type from a a decimal number in string form. More...
| Formattable (const UnicodeString &strToCopy)
| Creates a Formattable object with a UnicodeString object to copy from. More...
| Formattable (UnicodeString *strToAdopt)
| Creates a Formattable object with a UnicodeString object to adopt from. More...
| Formattable (const Formattable *arrayToCopy, int32_t count)
| Creates a Formattable object with an array of Formattable objects. More...
| Formattable (UObject *objectToAdopt)
| Creates a Formattable object that adopts the given UObject. More...
| Formattable (const Formattable &)
| Copy constructor. More...
Formattable & | operator= (const Formattable &rhs)
| Assignment operator. More...
UBool | operator== (const Formattable &other) const
| Equality comparison. More...
UBool | operator!= (const Formattable &other) const
| Equality operator. More...
virtual | ~Formattable ()
| Destructor. More...
Formattable * | clone () const
| Clone this object. More...
Type | getType (void) const
| Gets the data type of this Formattable object. More...
UBool | isNumeric () const
| Returns TRUE if the data type of this Formattable object is kDouble, kLong, or kInt64. More...
double | getDouble (void) const
| Gets the double value of this object. More...
double | getDouble (UErrorCode &status) const
| Gets the double value of this object. More...
int32_t | getLong (void) const
| Gets the long value of this object. More...
int32_t | getLong (UErrorCode &status) const
| Gets the long value of this object. More...
int64_t | getInt64 (void) const
| Gets the int64 value of this object. More...
int64_t | getInt64 (UErrorCode &status) const
| Gets the int64 value of this object. More...
UDate | getDate () const
| Gets the Date value of this object. More...
UDate | getDate (UErrorCode &status) const
| Gets the Date value of this object. More...
UnicodeString & | getString (UnicodeString &result) const
| Gets the string value of this object. More...
UnicodeString & | getString (UnicodeString &result, UErrorCode &status) const
| Gets the string value of this object. More...
const UnicodeString & | getString (void) const
| Gets a const reference to the string value of this object. More...
const UnicodeString & | getString (UErrorCode &status) const
| Gets a const reference to the string value of this object. More...
UnicodeString & | getString (void)
| Gets a reference to the string value of this object. More...
UnicodeString & | getString (UErrorCode &status)
| Gets a reference to the string value of this object. More...
const Formattable * | getArray (int32_t &count) const
| Gets the array value and count of this object. More...
const Formattable * | getArray (int32_t &count, UErrorCode &status) const
| Gets the array value and count of this object. More...
Formattable & | operator[] (int32_t index)
| Accesses the specified element in the array value of this Formattable object. More...
const UObject * | getObject () const
| Returns a pointer to the UObject contained within this formattable, or NULL if this object does not contain a UObject. More...
StringPiece | getDecimalNumber (UErrorCode &status)
| Returns a numeric string representation of the number contained within this formattable, or NULL if this object does not contain numeric type. More...
void | setDouble (double d)
| Sets the double value of this object and changes the type to kDouble. More...
void | setLong (int32_t l)
| Sets the long value of this object and changes the type to kLong. More...
void | setInt64 (int64_t ll)
| Sets the int64 value of this object and changes the type to kInt64. More...
void | setDate (UDate d)
| Sets the Date value of this object and changes the type to kDate. More...
void | setString (const UnicodeString &stringToCopy)
| Sets the string value of this object and changes the type to kString. More...
void | setArray (const Formattable *array, int32_t count)
| Sets the array value and count of this object and changes the type to kArray. More...
void | adoptString (UnicodeString *stringToAdopt)
| Sets and adopts the string value and count of this object and changes the type to kArray. More...
void | adoptArray (Formattable *array, int32_t count)
| Sets and adopts the array value and count of this object and changes the type to kArray. More...
void | adoptObject (UObject *objectToAdopt)
| Sets and adopts the UObject value of this object and changes the type to kObject. More...
void | setDecimalNumber (StringPiece numberString, UErrorCode &status)
| Sets the the numeric value from a decimal number string, and changes the type to to a numeric type appropriate for the number. More...
virtual UClassID | getDynamicClassID () const
| ICU "poor man's RTTI", returns a UClassID for the actual class. More...
UFormattable * | toUFormattable ()
| Convert this object pointer to a UFormattable. More...
const UFormattable * | toUFormattable () const
| Convert this object pointer to a UFormattable. More...
int32_t | getLong (UErrorCode *status) const
| Deprecated variant of getLong(UErrorCode&). More...
DigitList * | getDigitList () const
| Internal function, do not use. More...
DigitList * | getInternalDigitList ()
void | adoptDigitList (DigitList *dl)
| Adopt, and set value from, a DigitList Internal Function, do not use. More...
CharString * | internalGetCharString (UErrorCode &status)
| Internal function to return the CharString pointer. More...
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor. More...

## Static Public Member Functions
static UClassID | getStaticClassID ()
| ICU "poor man's RTTI", returns a UClassID for this class. More...
static Formattable * | fromUFormattable (UFormattable *fmt)
| Convert the UFormattable to a Formattable. More...
static const Formattable * | fromUFormattable (const UFormattable *fmt)
| Convert the const UFormattable to a const Formattable. More...

## Detailed Description

Formattable objects can be passed to the Format class or its subclasses for formatting.

Formattable is a thin wrapper class which interconverts between the primitive numeric types (double, long, etc.) as well as UDate and UnicodeString.

Internally, a Formattable object is a union of primitive types. As such, it can only store one flavor of data at a time. To determine what flavor of data it contains, use the getType method.

As of ICU 3.0, Formattable may also wrap a UObject pointer, which it owns. This allows an instance of any ICU class to be encapsulated in a Formattable. For legacy reasons and for efficiency, primitive numeric types are still stored directly within a Formattable.

The Formattable class is not suitable for subclassing.

See UFormattable for a C wrapper.

Definition at line 68 of file fmtable.h.

## Member Enumeration Documentation

enum icu::Formattable::ISDATE

This enum is only used to let callers distinguish between the Formattable(UDate) constructor and the Formattable(double) constructor; the compiler cannot distinguish the signatures, since UDate is currently typedefed to be either double or long.

If UDate is changed later to be a bonafide class or struct, then we no longer need this enum.

Stable:
  ICU 2.4

Definition at line 79 of file fmtable.h.

enum icu::Formattable::Type

Selector for flavor of data type contained within a Formattable object.

Formattable is a union of several different types, and at any time contains exactly one type.

Stable:
  ICU 2.4

Enumerator
kDate | Selector indicating a UDate value. Use getDate to retrieve the value. Stable: ICU 2.4
kDouble | Selector indicating a double value. Use getDouble to retrieve the value. Stable: ICU 2.4
kLong | Selector indicating a 32-bit integer value. Use getLong to retrieve the value. Stable: ICU 2.4
kString | Selector indicating a UnicodeString value. Use getString to retrieve the value. Stable: ICU 2.4
kArray | Selector indicating an array of Formattables. Use getArray to retrieve the value. Stable: ICU 2.4
kInt64 | Selector indicating a 64-bit integer value. Use getInt64 to retrieve the value. Stable: ICU 2.8
kObject | Selector indicating a UObject value. Use getObject to retrieve the value. Stable: ICU 3.0

Definition at line 225 of file fmtable.h.

## Constructor & Destructor Documentation

icu::Formattable::Formattable | ( |  | ) |

Default constructor.

Stable:
  ICU 2.4

icu::Formattable::Formattable | ( | UDate | d,
|  | ISDATE | flag
| ) |  |

Creates a Formattable object with a UDate instance.

Parameters

  d | the UDate instance.
  flag | the flag to indicate this is a date. Always set it to kIsDate

Stable:
  ICU 2.0

icu::Formattable::Formattable | ( | double | d | ) |

Creates a Formattable object with a double number.

Parameters

  d | the double number.

Stable:
  ICU 2.0

icu::Formattable::Formattable | ( | int32_t | l | ) |

Creates a Formattable object with a long number.

Parameters

  l | the long number.

Stable:
  ICU 2.0

icu::Formattable::Formattable | ( | int64_t | ll | ) |

Creates a Formattable object with an int64_t number.

Parameters

  ll | the int64_t number.

Stable:
  ICU 2.8

icu::Formattable::Formattable | ( | const char * | strToCopy | ) |

Creates a Formattable object with a char string pointer.

Assumes that the char string is null terminated.

Parameters

  strToCopy | the char string.

Stable:
  ICU 2.0

icu::Formattable::Formattable | ( | StringPiece | number,
|  | UErrorCode & | status
| ) |  |

Creates a Formattable object of an appropriate numeric type from a a decimal number in string form.

The Formattable will retain the full precision of the input in decimal format, even when it exceeds what can be represented by a double or int64_t.

Parameters

  number | the unformatted (not localized) string representation of the Decimal number.
  status | the error code. Possible errors include U_INVALID_FORMAT_ERROR if the format of the string does not conform to that of a decimal number.

Stable:
  ICU 4.4

icu::Formattable::Formattable | ( | const UnicodeString & | strToCopy | ) |

Creates a Formattable object with a UnicodeString object to copy from.

Parameters

  strToCopy | the UnicodeString string.

Stable:
  ICU 2.0

icu::Formattable::Formattable | ( | UnicodeString * | strToAdopt | ) |

Creates a Formattable object with a UnicodeString object to adopt from.

Parameters

  strToAdopt | the UnicodeString string.

Stable:
  ICU 2.0

icu::Formattable::Formattable | ( | const Formattable * | arrayToCopy,
|  | int32_t | count
| ) |  |

Creates a Formattable object with an array of Formattable objects.

Parameters

  arrayToCopy | the Formattable object array.
  count | the array count.

Stable:
  ICU 2.0

icu::Formattable::Formattable | ( | UObject * | objectToAdopt | ) |

Creates a Formattable object that adopts the given UObject.

Parameters

  objectToAdopt | the UObject to set this object to

Stable:
  ICU 3.0

icu::Formattable::Formattable | ( | const Formattable & |  | ) |

Copy constructor.

Stable:
  ICU 2.0

virtual icu::Formattable::~Formattable | ( |  | ) |
| virtual

Destructor.

Stable:
  ICU 2.0

## Member Function Documentation

void icu::Formattable::adoptArray | ( | Formattable * | array,
|  | int32_t | count
| ) |  |

Sets and adopts the array value and count of this object and changes the type to kArray.

Stable:
  ICU 2.0

void icu::Formattable::adoptDigitList | ( | DigitList * | dl | ) |

Adopt, and set value from, a DigitList Internal Function, do not use.

Parameters

  dl | the Digit List to be adopted

Internal:
  Do not use. This API is for internal use only.

void icu::Formattable::adoptObject | ( | UObject * | objectToAdopt | ) |

Sets and adopts the UObject value of this object and changes the type to kObject.

After this call, the caller must not delete the given object.

Parameters

  objectToAdopt | the UObject value to be adopted

Stable:
  ICU 3.0

void icu::Formattable::adoptString | ( | UnicodeString * | stringToAdopt | ) |

Sets and adopts the string value and count of this object and changes the type to kArray.

Parameters

  stringToAdopt | the new string value to be adopted.

Stable:
  ICU 2.0

Formattable* icu::Formattable::clone | ( |  | ) | const

Clone this object.

Clones can be used concurrently in multiple threads. If an error occurs, then NULL is returned. The caller must delete the clone.

Returns
  a clone of this object

See also
  getDynamicClassID

Stable:
  ICU 2.8

Formattable * icu::Formattable::fromUFormattable | ( | UFormattable * | fmt | ) |
| inline static

Convert the UFormattable to a Formattable.

Internally, this is a reinterpret_cast.

Parameters

  fmt | a valid UFormattable

Returns
  the UFormattable as a Formattable object pointer. This is an alias to the original UFormattable, and so is only valid while the original argument remains in scope.

Stable:
  ICU 52

Definition at line 749 of file fmtable.h.

const Formattable * icu::Formattable::fromUFormattable | ( | const UFormattable * | fmt | ) |
| inline static

Convert the const UFormattable to a const Formattable.

Internally, this is a reinterpret_cast.

Parameters

  fmt | a valid UFormattable

Returns
  the UFormattable as a Formattable object pointer. This is an alias to the original UFormattable, and so is only valid while the original argument remains in scope.

Stable:
  ICU 52

Definition at line 753 of file fmtable.h.

References U_NAMESPACE_END.

const Formattable* icu::Formattable::getArray | ( | int32_t & | count | ) | const
| inline

Gets the array value and count of this object.

If this object is not of type kArray then the result is undefined.

Parameters

  count | fill-in with the count of this object.

Returns
  the array value of this object.

Stable:
  ICU 2.0

Definition at line 447 of file fmtable.h.

const Formattable* icu::Formattable::getArray | ( | int32_t & | count,
|  | UErrorCode & | status
| ) |  | const

Gets the array value and count of this object.

If the type is not an array, status is set to U_INVALID_FORMAT_ERROR, count is set to 0, and the result is NULL.

Parameters

  count | fill-in with the count of this object.
  status | the error code.

Returns
  the array value of this object.

Stable:
  ICU 3.0

UDate icu::Formattable::getDate | ( |  | ) | const
| inline

Gets the Date value of this object.

If this object is not of type kDate then the result is undefined.

Returns
  the Date value of this object.

Stable:
  ICU 2.0

Definition at line 370 of file fmtable.h.

UDate icu::Formattable::getDate | ( | UErrorCode & | status | ) | const
| inline

Gets the Date value of this object.

If the type is not a date, status is set to U_INVALID_FORMAT_ERROR and the return value is undefined.

Parameters

  status | the error code.

Returns
  the Date value of this object.

Stable:
  ICU 3.0

Definition at line 717 of file fmtable.h.

References U_INVALID_FORMAT_ERROR, and U_SUCCESS.

StringPiece icu::Formattable::getDecimalNumber | ( | UErrorCode & | status | ) |

Returns a numeric string representation of the number contained within this formattable, or NULL if this object does not contain numeric type.

For values obtained by parsing, the returned decimal number retains the full precision and range of the original input, unconstrained by the limits of a double floating point or a 64 bit int.

This function is not thread safe, and therfore is not declared const, even though it is logically const.

Possible errors include U_MEMORY_ALLOCATION_ERROR, and U_INVALID_STATE if the formattable object has not been set to a numeric type.

Parameters

  status | the error code.

Returns
  the unformatted string representation of a number.

Stable:
  ICU 4.4

DigitList* icu::Formattable::getDigitList | ( |  | ) | const
| inline

Internal function, do not use.

TODO: figure out how to make this be non-public. NumberFormat::format(Formattable, ... needs to get at the DigitList, if it exists, for big decimal formatting.

Internal:
  Do not use. This API is for internal use only.

Definition at line 656 of file fmtable.h.

References UNUM_INTERNAL_STACKARRAY_SIZE.

double icu::Formattable::getDouble | ( | void |  | ) | const
| inline

Gets the double value of this object.

If this object is not of type kDouble then the result is undefined.

Returns
  the double value of this object.

Stable:
  ICU 2.0

Definition at line 297 of file fmtable.h.

double icu::Formattable::getDouble | ( | UErrorCode & | status | ) | const

Gets the double value of this object.

If this object is of type long, int64 or Decimal Number then a conversion is peformed, with possible loss of precision. If the type is kObject and the object is a Measure, then the result of getNumber().getDouble(status) is returned. If this object is neither a numeric type nor a Measure, then 0 is returned and the status is set to U_INVALID_FORMAT_ERROR.

Parameters

  status | the error code

Returns
  the double value of this object.

Stable:
  ICU 3.0

virtual UClassID icu::Formattable::getDynamicClassID | ( |  | ) | const
| virtual

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
  ICU 2.2

Reimplemented from icu::UObject.

int64_t icu::Formattable::getInt64 | ( | void |  | ) | const
| inline

Gets the int64 value of this object.

If this object is not of type kInt64 then the result is undefined.

Returns
  the int64 value of this object.

Stable:
  ICU 2.8

Definition at line 345 of file fmtable.h.

int64_t icu::Formattable::getInt64 | ( | UErrorCode & | status | ) | const

Gets the int64 value of this object.

If this object is of a numeric type and the magnitude is too large to fit in an int64, then the maximum or minimum int64 value, as appropriate, is returned and the status is set to U_INVALID_FORMAT_ERROR. If the magnitude fits in an int64, then a casting conversion is peformed, with truncation of any fractional part. If the type is kObject and the object is a Measure, then the result of getNumber().getDouble(status) is returned. If this object is neither a numeric type nor a Measure, then 0 is returned and the status is set to U_INVALID_FORMAT_ERROR.

Parameters

  status | the error code

Returns
  the int64 value of this object.

Stable:
  ICU 3.0

DigitList* icu::Formattable::getInternalDigitList | ( |  | ) |

Internal:
  Do not use.

This API is for internal use only.

int32_t icu::Formattable::getLong | ( | void |  | ) | const
| inline

Gets the long value of this object.

If this object is not of type kLong then the result is undefined.

Returns
  the long value of this object.

Stable:
  ICU 2.0

Definition at line 319 of file fmtable.h.

int32_t icu::Formattable::getLong | ( | UErrorCode & | status | ) | const

Gets the long value of this object.

If the magnitude is too large to fit in a long, then the maximum or minimum long value, as appropriate, is returned and the status is set to U_INVALID_FORMAT_ERROR. If this object is of type kInt64 and it fits within a long, then no precision is lost. If it is of type kDouble, then a conversion is peformed, with truncation of any fractional part. If the type is kObject and the object is a Measure, then the result of getNumber().getLong(status) is returned. If this object is neither a numeric type nor a Measure, then 0 is returned and the status is set to U_INVALID_FORMAT_ERROR.

Parameters

  status | the error code

Returns
  the long value of this object.

Stable:
  ICU 3.0

int32_t icu::Formattable::getLong | ( | UErrorCode * | status | ) | const
| inline

Deprecated variant of getLong(UErrorCode&).

Parameters

  status | the error code

Returns
  the long value of this object.

Deprecated:
  ICU 3.0 use getLong(UErrorCode&) instead

Definition at line 736 of file fmtable.h.

const UObject* icu::Formattable::getObject | ( |  | ) | const

Returns a pointer to the UObject contained within this formattable, or NULL if this object does not contain a UObject.

Returns
  a UObject pointer, or NULL

Stable:
  ICU 3.0

static UClassID icu::Formattable::getStaticClassID | ( |  | ) |
| static

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
  ICU 2.2

UnicodeString& icu::Formattable::getString | ( | UnicodeString & | result | ) | const
| inline

Gets the string value of this object.

If this object is not of type kString then the result is undefined.

Parameters

  result | Output param to receive the Date value of this object.

Returns
  A reference to 'result'.

Stable:
  ICU 2.0

Definition at line 389 of file fmtable.h.

UnicodeString& icu::Formattable::getString | ( | UnicodeString & | result,
|  | UErrorCode & | status
| ) |  | const

Gets the string value of this object.

If the type is not a string, status is set to U_INVALID_FORMAT_ERROR and a bogus string is returned.

Parameters

  result | Output param to receive the Date value of this object.
  status | the error code.

Returns
  A reference to 'result'.

Stable:
  ICU 3.0

const UnicodeString & icu::Formattable::getString | ( | void |  | ) | const
| inline

Gets a const reference to the string value of this object.

If this object is not of type kString then the result is undefined.

Returns
  a const reference to the string value of this object.

Stable:
  ICU 2.0

Definition at line 727 of file fmtable.h.

const UnicodeString& icu::Formattable::getString | ( | UErrorCode & | status | ) | const

Gets a const reference to the string value of this object.

If the type is not a string, status is set to U_INVALID_FORMAT_ERROR and the result is a bogus string.

Parameters

  status | the error code.

Returns
  a const reference to the string value of this object.

Stable:
  ICU 3.0

UnicodeString & icu::Formattable::getString | ( | void |  | ) |
| inline

Gets a reference to the string value of this object.

If this object is not of type kString then the result is undefined.

Returns
  a reference to the string value of this object.

Stable:
  ICU 2.0

Definition at line 731 of file fmtable.h.

UnicodeString& icu::Formattable::getString | ( | UErrorCode & | status | ) |

Gets a reference to the string value of this object.

If the type is not a string, status is set to U_INVALID_FORMAT_ERROR and the result is a bogus string.

Parameters

  status | the error code.

Returns
  a reference to the string value of this object.

Stable:
  ICU 3.0

Type icu::Formattable::getType | ( | void |  | ) | const

Gets the data type of this Formattable object.

Returns
  the data type of this Formattable object.

Stable:
  ICU 2.0

CharString* icu::Formattable::internalGetCharString | ( | UErrorCode & | status | ) |

Internal function to return the CharString pointer.

Parameters

  status | error code

Returns
  pointer to the CharString - may become invalid if the object is modified

Internal:
  Do not use. This API is for internal use only.

UBool icu::Formattable::isNumeric | ( |  | ) | const

Returns TRUE if the data type of this Formattable object is kDouble, kLong, or kInt64.

Returns
  TRUE if this is a pure numeric object

Stable:
  ICU 3.0

UBool icu::Formattable::operator!= | ( | const Formattable & | other | ) | const
| inline

Equality operator.

Parameters

  other | the object to be compared with.

Returns
  TRUE if other are unequal to this, FALSE otherwise.

Stable:
  ICU 2.0

Definition at line 197 of file fmtable.h.

References icu::operator==().

Formattable& icu::Formattable::operator= | ( | const Formattable & | rhs | ) |

Assignment operator.

Parameters

  rhs | The Formattable object to copy into this object.

Stable:
  ICU 2.0

UBool icu::Formattable::operator== | ( | const Formattable & | other | ) | const

Equality comparison.

Parameters

  other | the object to be compared with.

Returns
  TRUE if other are equal to this, FALSE otherwise.

Stable:
  ICU 2.0

Formattable& icu::Formattable::operator[] | ( | int32_t | index | ) |
| inline

Accesses the specified element in the array value of this Formattable object.

If this object is not of type kArray then the result is undefined.

Parameters

  index | the specified index.

Returns
  the accessed element in the array.

Stable:
  ICU 2.0

Definition at line 469 of file fmtable.h.

References icu::UObject::getDynamicClassID().

void icu::Formattable::setArray | ( | const Formattable * | array,
|  | int32_t | count
| ) |  |

Sets the array value and count of this object and changes the type to kArray.

Parameters

  array | the array value.
  count | the number of array elements to be copied.

Stable:
  ICU 2.0

void icu::Formattable::setDate | ( | UDate | d | ) |

Sets the Date value of this object and changes the type to kDate.

Parameters

  d | the new Date value to be set.

Stable:
  ICU 2.0

void icu::Formattable::setDecimalNumber | ( | StringPiece | numberString,
|  | UErrorCode & | status
| ) |  |

Sets the the numeric value from a decimal number string, and changes the type to to a numeric type appropriate for the number.

The syntax of the number is a "numeric string" as defined in the Decimal Arithmetic Specification, available at http://speleotrove.com/decimal The full precision and range of the input number will be retained, even when it exceeds what can be represented by a double or an int64.

Parameters

  numberString | a string representation of the unformatted decimal number.
  status | the error code. Set to U_INVALID_FORMAT_ERROR if the incoming string is not a valid decimal number.

Stable:
  ICU 4.4

void icu::Formattable::setDouble | ( | double | d | ) |

Sets the double value of this object and changes the type to kDouble.

Parameters

  d | the new double value to be set.

Stable:
  ICU 2.0

void icu::Formattable::setInt64 | ( | int64_t | ll | ) |

Sets the int64 value of this object and changes the type to kInt64.

Parameters

  ll | the new int64 value to be set.

Stable:
  ICU 2.8

void icu::Formattable::setLong | ( | int32_t | l | ) |

Sets the long value of this object and changes the type to kLong.

Parameters

  l | the new long value to be set.

Stable:
  ICU 2.0

void icu::Formattable::setString | ( | const UnicodeString & | stringToCopy | ) |

Sets the string value of this object and changes the type to kString.

Parameters

  stringToCopy | the new string value to be set.

Stable:
  ICU 2.0

UFormattable * icu::Formattable::toUFormattable | ( |  | ) |
| inline

Convert this object pointer to a UFormattable.

Returns
  this object as a UFormattable pointer. This is an alias to this object, and so is only valid while this object remains in scope.

Stable:
  ICU 52

Definition at line 741 of file fmtable.h.

const UFormattable * icu::Formattable::toUFormattable | ( |  | ) | const
| inline

Convert this object pointer to a UFormattable.

Returns
  this object as a UFormattable pointer. This is an alias to this object, and so is only valid while this object remains in scope.

Stable:
  ICU 52

Definition at line 745 of file fmtable.h.

The documentation for this class was generated from the following file:

- fmtable.h