Logo Search packages:      
Sourcecode: icu version File versions

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.

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

Implemented in ChoiceFormat, DecimalFormat, RuleBasedNumberFormat, StubNumberForamt, and MyNumberFormatTest.

Referenced by NumFmtFunction::call(), FractionalPartSubstitution::doParse(), NFSubstitution::doParse(), parse(), parseCurrency(), TimeZone::parseCustomID(), SimpleDateFormat::parseInt(), parseObject(), NumberFormatRegressionTest::Test4162198(), NumberFormatRegressionTest::Test4162852(), NumberFormatRegressionTest::Test4167494(), IntlTestNumberFormatAPI::testAPI(), NumberFormatTest::TestLenientParse(), TestMessageFormat::TestRBNF(), and IntlTestNumberFormat::tryIt().

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index