Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

DigitConverter Class Reference

The DigitConverter class converts non-ASCII UTF-8 Unicode digits to their ASCII equivalents. More...

#include <DigitConverter.h>

List of all members.

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


Detailed Description

The DigitConverter class converts non-ASCII UTF-8 Unicode digits to their ASCII equivalents.

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.


Constructor & Destructor Documentation

DigitConverter::DigitConverter const char *  p,
int  stt,
int  end
 

This constructor is tailored for use by the MadelineTable class.

DigitConverter::DigitConverter const char *  p  ) 
 

Constructor taking const char *.

DigitConverter::DigitConverter const std::string &  input  ) 
 

Constructor taking const reference to a standard string.


Member Function Documentation

bool DigitConverter::_isASCII void   )  [private]
 

_isASCII(): Tests the high bits in a UTF-8 string to see if there are characters outside the ASCII range or not.

void DigitConverter::_normalize void   )  [private]
 

const std::string DigitConverter::get void   )  const
 

get(): Returns the normalized version of the string

void DigitConverter::set const std::string &  input  ) 
 

set(): method taking const reference to a standard string

void DigitConverter::set const char *  p  ) 
 

set(): method taking const char *

void DigitConverter::set const char *  p,
int  stt,
int  end
 

set(): method tailored for use by the MadelineTable class


Member Data Documentation

const char * DigitConverter::_ArabicIndicDigits [static, private]
 

Initial value:

{
        "0","1","2","3","4","5","6","7","8","9"
}

const char * DigitConverter::_digits [static, private]
 

Initial value:

{
        "٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩",
        "०","१","२","३","४","५","६","७","८","९",
        "๐","๑","๒","๓","๔","๕","๖","๗","๘","๙",
        "໐","໑","໒","໓","໔","໕","໖","໗","໘","໙",
        "༠","༡","༢","༣","༤","༥","༦","༧","༨","༩",
        "〇","一","二","三","四","五","六","七","八","九",
        "0","1","2","3","4","5","6","7","8","9",
        "০","১","২","৩","৪","৫","৬","৭","৮","৯",
        "੦","੧","੨","੩","੪","੫","੬","੭","੮","੯",
        "૦","૧","૨","૩","૪","૫","૬","૭","૮","૯",
        "୦","୧","୨","୩","୪","୫","୬","୭","୮","୯",
        "*","௧","௨","௩","௪","௫","௬","௭","௮","௯",
        "౦","౧","౨","౩","౪","౫","౬","౭","౮","౯",
        "೦","೧","೨","೩","೪","೫","೬","೭","೮","೯",
        "൦","൧","൨","൩","൪","൫","൬","൭","൮","൯",
        "零","壹","貳","叄","肆","伍","陸","柒","捌","玖",
        "*","么","贰","參","〤","〥","陆","〧","〨","〩",
        "۰","۱","۲","۳","۴","۵","۶","۷","۸","۹",
        "၀","၁","၂","၃","၄","၅","၆","၇","၈","၉",
        "*","፩","፪","፫","፬","፭","፮","፯","፰","፱",
        "០","១","២","៣","៤","៥","៦","៧","៨","៩",
        "᠐","᠑","᠒","᠓","᠔","᠕","᠖","᠗","᠘","᠙"
}

std::string DigitConverter::_input [private]
 

const int DigitConverter::TABLE_SIZE = 220 [static, private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 18 16:24:39 2011 for MADELINE by  doxygen 1.4.4