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


C++ TDes16::Append方法代码示例

本文整理汇总了C++中TDes16::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ TDes16::Append方法的具体用法?C++ TDes16::Append怎么用?C++ TDes16::Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDes16的用法示例。


在下文中一共展示了TDes16::Append方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: totalConverted

// -----------------------------------------------------------------------------
// JPLangUtil::ConvertFullHiragnaToFullKatakana
// Converts Full-width Hiragana and Special Character text found in
// aUnicodeSource to their Full-width counterparts and places the
// resulting text into aUnicodeTarget.
// -----------------------------------------------------------------------------
//
EXPORT_C TInt JPLangUtil::ConvertFullHiragnaToFullKatakana
                       ( const TDesC16& aUnicodeSource, TDes16& aUnicodeTarget )
    {
    TInt totalConverted( 0 );
    const TInt length( aUnicodeSource.Length() );
    const TInt maxLength( aUnicodeTarget.MaxLength() );
    if( length > maxLength )
        {
        return KErrTooBig;
        }

    const TUint comp = KFullWidthKatakanaSmallA - KFullWidthHiraganaSmallA;

    aUnicodeTarget.Zero();
    for( TInt i( 0 ); i < length; ++i )
        {
        const TText uniChar( aUnicodeSource[i] );
        TText uniChar2(0);
        if (i + 1 < length)
            {
            uniChar2 = aUnicodeSource[i+1];
            }
        // First check if this is this Full Width Katakana
        if (KFullWidthHiraganaSmallA <= uniChar && uniChar <= KFullWidthHiraganaVU)
            {
            if (uniChar == KFullWidthHiraganaU
             && uniChar2 == KFullWidthHiraganaVoicedSound)
                {
                aUnicodeTarget.Append(KFullWidthKatakanaSmallVU);
                totalConverted++;
                i++;
                }
            else
                {
                TUint katakana = uniChar + comp;
                if (IsKatakana(katakana))
                    {
                    aUnicodeTarget.Append(katakana);
                    totalConverted++;
                    }
                }
            }
        else
            {
            aUnicodeTarget.Append(uniChar);
            totalConverted++;
            }
        }

    // Now handle special characters
    // This logic may be moved into this function to avoid another loop over
    // the text
    totalConverted +=
        UnicodeTextUtil::ConvertSpecialCharactersInPlace( EFullToHalfWidth,
                                                          aUnicodeTarget );

    return totalConverted;
    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:65,代码来源:jplangutil.cpp

示例2: Externalize

TInt TEnvVar::Externalize(TDes16& aBuffer)
	{
	if (iName==0) 
		return 0;
	aBuffer.Append(*iName);
	aBuffer.Append(TChar(0));
	aBuffer.Append(*iValue);
	aBuffer.Append(TChar(0));
	return 1;
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:10,代码来源:GETENV.CPP

示例3: Temperature

void CBatmonContainer::Temperature(TDes16& aValue,TUint16 aAddress) const
{
  TRAPD(err,HWNetmon::ValueL(KPhoneEnergyUnit,aAddress,aValue,HWNetmon::EExt|HWNetmon::ERaw));
  if(err==KErrNone&&aValue.Length()>2)
  {
    TInt value=aValue[1]*256+aValue[2]-273;
    aValue.Num(value);
    aValue.Append(0xb0);
    aValue.Append('C');
  }
  else
  {
    aValue.Zero();
    aValue.Append('?');
  }
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:16,代码来源:BatmonContainer.cpp

示例4: Value

void CBatmonContainer::Value(TUint8 aUnit,TUint16 aAddress,TDes16& aValue) const
{
  TRAPD(err,HWNetmon::ValueL(aUnit,aAddress,aValue,HWNetmon::EExt|HWNetmon::ESigned));
  if(err!=KErrNone)
  {
    aValue.Zero();
    aValue.Append('?');
  }
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:9,代码来源:BatmonContainer.cpp

示例5:

void CT_KOI8R::Merge_Big(TDesC8& aSource, TDes16& aTarget)
	{
	TInt length = aSource.Length();
	TInt i = 0;
	for(i=0;i<length-1;i++)
		{
		TInt64 temp = *(aSource.Ptr()+(i))*16*16 + *(aSource.Ptr()+i+1);
		aTarget.Append(temp);
		i++;
		}	
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:11,代码来源:t_koi8r.cpp

示例6: FileNameGen

/** Generates a file name of the form FFFFF*<aPos>.TXT (aLong.3)

	@param aBuffer The filename will be returned here
	@param aLong   Defines the longitude of the file name 
	@param aPos	   Defines the number that will be attached to the filename
*/
void FileNameGen(TDes16& aBuffer, TInt aLong, TInt aPos) 
{
	TInt padding;
	TInt i=0;
	TBuf16<10> tempbuf;
	
	_LIT(KNumber,"%d");
	tempbuf.Format(KNumber,aPos);
	padding=aLong-tempbuf.Size()/2;
	aBuffer=_L("");
	while(i<padding)
	{
		aBuffer.Append('F');
		i++;
	}
	aBuffer.Append(tempbuf);
	
	_LIT(KExtension1, ".TXT");
	aBuffer.Append(KExtension1);
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:26,代码来源:t_fsched.cpp

示例7: Unicode_Big

//translate from unicode big endian TDesC8 to TDes16
void CT_TURKISHLOCKING::Unicode_Big(TDesC8& aSource, TDes16& aTarget)
	{
	TInt length = aSource.Length();
	TInt i = 0;
	for(i=0;i<length-1;i++)
		{
		TInt32 temp = *(aSource.Ptr()+(i))*16*16 + *(aSource.Ptr()+i+1);
		aTarget.Append(temp);
		i++;
		}	
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:12,代码来源:t_turkishlocking.cpp

示例8: Battery

void CBatmonContainer::Battery(TDes16& aValue,TUint16 aAddress) const
{
  TInt value=0;
  TRAPD(err,HWNetmon::ValueL(KPhoneEnergyUnit,aAddress,aValue,HWNetmon::EExt|HWNetmon::ERaw));
  if(err==KErrNone&&aValue.Length()>0) value=aValue[0];
  aValue.Zero();
  switch(value)
  {
    case 11:
      aValue.Append(_L("BL-4C"));
      break;
    case 12:
      aValue.Append(_L("BL-5C"));
      break;
    case 17:
      aValue.Append(_L("BL-6C"));
      break;
    default:
      aValue.Append('?');
      break;
  }
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:22,代码来源:BatmonContainer.cpp

示例9: Hour

void CBatmonContainer::Hour(TDes16& aValue,TUint16 aAddress) const
{
  Value(KPhoneEnergyUnit,aAddress,aValue);
  aValue.Append(_L(" h"));
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:5,代码来源:BatmonContainer.cpp

示例10: Impedance

void CBatmonContainer::Impedance(TDes16& aValue,TUint16 aAddress) const
{
  Value(KPhoneEnergyUnit,aAddress,aValue);
  aValue.Append(_L(" m"));
  aValue.Append(0x3a9);
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:6,代码来源:BatmonContainer.cpp


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