|
||
class NumberConversion;
Functions for converting numbers between different numbers form different scripts. The scripts supported are those given in enum TDigitType.
Defined in NumberConversion
:
AppendFormatNumber(TDes &,TInt,TDigitType)
Converts a non-negative integer into localised text, appending the result to a d...ConvertDigit(TChar &,TDigitType)
converts aDigit (which could be arabic, western digit etc) into the form denoted...ConvertDigits(TDes &,TDigitType)
Converts all of the digits in the descriptor aText into the format specified in ...ConvertFirstNumber(const TDesC &,TInt &,TDigitType &,TDigitMatchType)
Converts the descriptor aText into an integer and returns it. Ignores any minus ...EMatchMultipleTypes
EMatchSingleTypeOnly
Format(TDigitType,TRefByValue< TDes >,...)
Formats the descriptor. Format specifiers are converted to values passed in the ...FormatDigit(TDes &,TInt,TInt,TDigitType)
Converts a non-negative integer into localised text.FormatNumber(TDes &,TInt,TDigitType)
Converts a non-negative integer into localised text. LengthOfConvertedText(const TDesC &,TDigitType)
Returns the length of the descriptor required to hold text with its digits conve...LengthOfFormattedNumber(TInt,TDigitType)
Returns the number of characters required to format aNumber into text. PositionAndTypeOfNextNumber(const TDesC &,TDigitType &,TInt)
Finds the position and type of the next number in the descriptor. If the number ...TDigitMatchType
IMPORT_C static TInt ConvertFirstNumber(const TDesC &aText, TInt &aLength, TDigitType &aDigitType, TDigitMatchType aDigitMatchType=EMatchMultipleTypes);
Converts the descriptor aText into an integer and returns it. Ignores any minus signs: only non-negative numbers are returned.
|
|
IMPORT_C static TInt PositionAndTypeOfNextNumber(const TDesC &aText, TDigitType &aDigitType, TInt aStartFrom=0);
Finds the position and type of the next number in the descriptor. If the number has a preceeding minus sign, it will be ignored and the position of the first digit will be returned.
|
|
IMPORT_C static void FormatNumber(TDes &aText, TInt aNumber, TDigitType aDigitType);
NumberConversion::LengthOfFormattedNumber(aNumber, aDigitType) <= aText.MaxLength() && 0 <= aNumber
Converts a non-negative integer into localised text.
|
IMPORT_C static void FormatDigit(TDes &aText, TInt aNumber, TInt aLeadingZero, TDigitType aDigitType);
NumberConversion::LengthOfFormattedNumber(aNumber, aDigitType) <= aText.MaxLength() && 0 <= aNumber
Converts a non-negative integer into localised text.
|
IMPORT_C static void AppendFormatNumber(TDes &aText, TInt aNumber, TDigitType aDigitType);
NumberConversion::LengthOfFormattedNumber(aNumber, aDigitType) <= aText.MaxLength() - aText.Length() && 0 <= aNumber
Converts a non-negative integer into localised text, appending the result to a descriptor.
|
IMPORT_C static void ConvertDigits(TDes &aText, TDigitType aDigitType);
NumberConversion::LengthOfConvertedText(aText, aDigitType) <= aText.MaxLength()
Converts all of the digits in the descriptor aText into the format specified in aDigitType.
All digits in the string will either conform to one of the constants defined in enum TDigitType or will match the digit type supplied in aDigitType.
|
IMPORT_C static TInt LengthOfFormattedNumber(TInt aNumber, TDigitType aDigitType);
Returns the number of characters required to format aNumber into text.
|
|
IMPORT_C static TInt LengthOfConvertedText(const TDesC &aText, TDigitType aDigitType);
Returns the length of the descriptor required to hold text with its digits converted.
|
|
IMPORT_C static void Format(TDigitType aDigitType, TRefByValue< TDes > aFmt,...);
Formats the descriptor. Format specifiers are converted to values passed in the variable argument list. The following format specifiers are supported:
d - Interprets the argument as a TInt and formats it using the aDigitType format. Negative numbers are not supported.
S - Interprets the argument as a pointer to a TDesC and inserts it into the descriptor.
|
IMPORT_C static TChar ConvertDigit(TChar &aDigit, TDigitType aDigitType);
converts aDigit (which could be arabic, western digit etc) into the form denoted by aDigitType.
|
|