#include <DigitConverter.h>
Public Member Functions | |
| DigitConverter (const char *p, int stt, int end) | |
| This constructor is tailored for use by the MadelineTable class. | |
| DigitConverter (const char *p) | |
| Constructor taking const char *. | |
| DigitConverter (const std::string &input) | |
| Constructor taking const reference to a standard string. | |
| void | set (const char *p, int stt, int end) |
| set(): method tailored for use by the MadelineTable class | |
| void | set (const char *p) |
| set(): method taking const char * | |
| void | set (const std::string &input) |
| set(): method taking const reference to a standard string | |
| const std::string | get (void) const |
| get(): Returns the normalized version of the string | |
Private Member Functions | |
| bool | _isASCII (void) |
| void | _normalize (void) |
Private Attributes | |
| std::string | _input |
Static Private Attributes | |
| static const char * | _digits [] |
| static const char * | _ArabicIndicDigits [] |
| static const int | TABLE_SIZE = 220 |
The DigitConverter class converts non-ASCII UTF-8 Unicode digits in C strings or std::strings to their ASCII equivalents. Non-digit characters remain unchanged. A DigitConverter object can be instantiated with a C string or std::string. There is also a constructor tailored for use with the MadelineTable class which takes a pointer to a char string and start and end offsets into the string. The get() method returns a std::string in which all of the non-ASCII digits have been converted to ASCII equivalents.
|
||||||||||||||||
|
This constructor is tailored for use by the MadelineTable class.
|
|
|
Constructor taking const char *.
|
|
|
Constructor taking const reference to a standard string.
|
|
|
_isASCII(): Tests the high bits in a UTF-8 string to see if there are characters outside the ASCII range or not. |
|
|
|
|
|
get(): Returns the normalized version of the string
|
|
|
set(): method taking const reference to a standard string
|
|
|
set(): method taking const char *
|
|
||||||||||||||||
|
set(): method tailored for use by the MadelineTable class
|
|
|
Initial value: {
"0","1","2","3","4","5","6","7","8","9"
}
|
|
|
Initial value: {
"٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩",
"०","१","२","३","४","५","६","७","८","९",
"๐","๑","๒","๓","๔","๕","๖","๗","๘","๙",
"໐","໑","໒","໓","໔","໕","໖","໗","໘","໙",
"༠","༡","༢","༣","༤","༥","༦","༧","༨","༩",
"〇","一","二","三","四","五","六","七","八","九",
"0","1","2","3","4","5","6","7","8","9",
"০","১","২","৩","৪","৫","৬","৭","৮","৯",
"੦","੧","੨","੩","੪","੫","੬","੭","੮","੯",
"૦","૧","૨","૩","૪","૫","૬","૭","૮","૯",
"୦","୧","୨","୩","୪","୫","୬","୭","୮","୯",
"*","௧","௨","௩","௪","௫","௬","௭","௮","௯",
"౦","౧","౨","౩","౪","౫","౬","౭","౮","౯",
"೦","೧","೨","೩","೪","೫","೬","೭","೮","೯",
"൦","൧","൨","൩","൪","൫","൬","൭","൮","൯",
"零","壹","貳","叄","肆","伍","陸","柒","捌","玖",
"*","么","贰","參","〤","〥","陆","〧","〨","〩",
"۰","۱","۲","۳","۴","۵","۶","۷","۸","۹",
"၀","၁","၂","၃","၄","၅","၆","၇","၈","၉",
"*","፩","፪","፫","፬","፭","፮","፯","፰","፱",
"០","១","២","៣","៤","៥","៦","៧","៨","៩",
"᠐","᠑","᠒","᠓","᠔","᠕","᠖","᠗","᠘","᠙"
}
|
|
|
|
|
|
|
1.4.4