当前位置: 首页>>代码示例>>C++>>正文


C++ TChar::GetBdCategory方法代码示例

本文整理汇总了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 );    
            }        
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:28,代码来源:basepluginresourceloader.cpp

示例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;
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:46,代码来源:basepluginresourceloader.cpp


注:本文中的TChar::GetBdCategory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。