本文整理汇总了C++中TChar::GetBdCategory方法的典型用法代码示例。如果您正苦于以下问题:C++ TChar::GetBdCategory方法的具体用法?C++ TChar::GetBdCategory怎么用?C++ TChar::GetBdCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TChar
的用法示例。
在下文中一共展示了TChar::GetBdCategory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NumberToBase
/**
This routine is used to convert Arabic-Indic, Eastern Arabic-Indic
or Devanagari digits to European digits.
@param aDes Parameter to change
*/
void CResourceLoader::LanguageSpecificNumberConverter::ConvertToWesternNumbers( TDes &aDes )
{
const TChar toArea = 0x030;
const TInt KLastDevanagariDigit = 0x96F;
const TInt KFirstDevanagariDigit = 0x966;
const TInt length = aDes.Length();
for( TInt i=0; i<length; i++ )
{
TChar character = aDes[i];
TChar fromArea = NumberToBase( character );
TChar::TBdCategory cat = character.GetBdCategory();
if ( cat == TChar::EArabicNumber || cat == TChar::EEuropeanNumber ||
( KFirstDevanagariDigit <= character && character <= KLastDevanagariDigit ) )
{
character += toArea;
character -= fromArea;
aDes[i] = TUint16( character );
}
}
}
示例2: switch
/**
This routine is used to convert between European digits and
Arabic-Indic, Eastern Arabic-Indic, Devanagari or Thai digits
based on existing digit type setting.
@param aDes Parameter to change
*/
void CResourceLoader::LanguageSpecificNumberConverter::Convert( TDes &aDes )
{
TLocale locale;
locale.Refresh();
const TDigitType digitType = locale.DigitType();
TChar toArea = 0x030;
switch( digitType )
{
case EDigitTypeWestern:
case EDigitTypeArabicIndic:
case EDigitTypeEasternArabicIndic:
case EDigitTypeDevanagari:
case EDigitTypeThai:
toArea = digitType;
break;
case EDigitTypeUnknown:
case EDigitTypeAllTypes:
return;
}
const TInt length = aDes.Length();
for( TInt i = 0; i < length; i++ )
{
TChar character = aDes[i];
TChar fromArea = NumberToBase( character );
TChar::TBdCategory cat = character.GetBdCategory();
switch( cat )
{
case TChar::EArabicNumber:
case TChar::EEuropeanNumber:
character += toArea;
character -= fromArea;
aDes[i] = TUint16( character );
break;
default:
break;
}
}
}