Logo Search packages:      
Sourcecode: icu version File versions  Download package

UnicodeString & Format::format ( const Formattable obj,
UnicodeString appendTo,
FieldPositionIterator posIter,
UErrorCode status 
) const [virtual, inherited]

Format an object to produce a string. Subclasses should override this method. This method allows polymorphic formatting of Formattable objects. If a subclass of Format receives a Formattable object type it doesn't handle (e.g., if a numeric Formattable is passed to a DateFormat object) then it returns a failing UErrorCode.

Parameters:
obj The object to format.
appendTo Output parameter to receive result. Result is appended to existing contents.
posIter On return, can be used to iterate over positions of fields generated by this format call.
status Output param filled with success/failure status.
Returns:
Reference to 'appendTo' parameter. ICU 4.4

Reimplemented in DateFormat, NumberFormat, and SimpleDateFormat.

Definition at line 119 of file format.cpp.

References U_FAILURE, and U_UNSUPPORTED_ERROR.

{
    if (!U_FAILURE(status)) {
      status = U_UNSUPPORTED_ERROR;
    }
    return toAppendTo;
}


Generated by  Doxygen 1.6.0   Back to index