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

virtual void NumberFormat::parse ( const UnicodeString text,
Formattable result,
ParsePosition parsePosition 
) const [pure virtual]

Return a long if possible (e.g. within range LONG_MAX, LONG_MAX], and with no decimals), otherwise a double. If IntegerOnly is set, will stop at a decimal point (or equivalent; e.g. for rational numbers "1 2/3", will stop after the 1).

If no object can be parsed, index is unchanged, and NULL is returned.

This is a pure virtual which concrete subclasses must implement.

Parameters:
text The text to be parsed.
result Formattable to be set to the parse result. If parse fails, return contents are undefined.
parsePosition The position to start parsing at on input. On output, moved to after the last successfully parse character. On parse failure, does not change.
Returns:
A Formattable object of numeric type. The caller owns this an must delete it. NULL on failure. ICU 2.0

Implemented in ChoiceFormat, DecimalFormat, and RuleBasedNumberFormat.

Referenced by RuleBasedNumberFormat::parse(), parse(), DecimalFormat::parse(), ChoiceFormat::parse(), parseCurrency(), TimeZone::parseCustomID(), SimpleDateFormat::parseInt(), parseObject(), NumberFormatRegressionTest::Test4162198(), NumberFormatRegressionTest::Test4162852(), NumberFormatRegressionTest::Test4167494(), IntlTestNumberFormatAPI::testAPI(), TestMessageFormat::TestRBNF(), and IntlTestNumberFormat::tryIt().


Generated by  Doxygen 1.6.0   Back to index