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

void Format::parseObject ( const UnicodeString source,
Formattable result,
UErrorCode status 
) const [inherited]

Parses a string to produce an object. This is a convenience method which calls the pure virtual parseObject() method, and returns a failure UErrorCode if the ParsePosition indicates failure.

Parameters:
source The string to be parsed into an object.
result Formattable to be set to the parse result. If parse fails, return contents are undefined.
status Output param to be filled with success/failure result code. ICU 2.0

Definition at line 135 of file format.cpp.

References ParsePosition::getIndex(), Format::parseObject(), U_FAILURE, and U_INVALID_FORMAT_ERROR.

{
    if (U_FAILURE(status)) return;

    ParsePosition parsePosition(0);
    parseObject(source, result, parsePosition);
    if (parsePosition.getIndex() == 0) {
        status = U_INVALID_FORMAT_ERROR;
    }
}


Generated by  Doxygen 1.6.0   Back to index