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


C++ TDesC16::Right方法代码示例

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


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

示例1:

void CT_ISO2022JP1_2::TestSplittingConvertingFromUnicodeToIso2022Jp(
                CCnvCharacterSetConverter& aCharacterSetConverter,
                TInt aMaximumLengthLowerLimit,
                TInt aMaximumLengthUpperLimit,
                TInt aExpectedNumberOfUnicodeCharactersNotConvertedAtSplit,
                const TDesC8& aExpectedFirstPartOfIso2022Jp,
                const TDesC8& aExpectedSecondPartOfIso2022Jp,
                const TDesC16& aOriginalUnicode)
	{
	INFO_PRINTF1(_L(" TestTruncatedConversionFromUnicodeToIso2022Jp "));
	test(aMaximumLengthLowerLimit<=aMaximumLengthUpperLimit);
	test(aMaximumLengthUpperLimit<=KBufferLength);
	TUint8 iso2022JpBuffer[KBufferLength];
	for (TInt i=aMaximumLengthLowerLimit; i<=aMaximumLengthUpperLimit; ++i)
		{
		TPtr8 generatedFirstPartOfIso2022Jp(iso2022JpBuffer, i);
		test(aCharacterSetConverter.ConvertFromUnicode(generatedFirstPartOfIso2022Jp, aOriginalUnicode)==aExpectedNumberOfUnicodeCharactersNotConvertedAtSplit);
		test(generatedFirstPartOfIso2022Jp==aExpectedFirstPartOfIso2022Jp);
		TBuf8<KBufferLength> generatedSecondPartOfIso2022Jp;
		test(aCharacterSetConverter.ConvertFromUnicode(generatedSecondPartOfIso2022Jp, aOriginalUnicode.Right(aExpectedNumberOfUnicodeCharactersNotConvertedAtSplit))==0);
		test(generatedSecondPartOfIso2022Jp==aExpectedSecondPartOfIso2022Jp);
		TInt state=CCnvCharacterSetConverter::KStateDefault;
		TBuf16<KBufferLength> generatedUnicode;
		test(aCharacterSetConverter.ConvertToUnicode(generatedUnicode, generatedFirstPartOfIso2022Jp, state)==0);
		TBuf16<KBufferLength> generatedSecondPartOfUnicode;
		test(aCharacterSetConverter.ConvertToUnicode(generatedSecondPartOfUnicode, generatedSecondPartOfIso2022Jp, state)==0);
		generatedUnicode.Append(generatedSecondPartOfUnicode);
		test(generatedUnicode==aOriginalUnicode);
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:30,代码来源:t_iso2022jp1_2.cpp

示例2: generatedFirstPartOfEucJpPacked

/**
@SYMTestCaseID          SYSLIB-CHARCONV-CT-0536
@SYMTestCaseDesc        Splitting and converting from Unicode to EucJpPacked test
@SYMTestPriority        Medium
@SYMTestActions         Tests for conversion after splitting, from Unicode to EucJpPacked and back to Unicode
@SYMTestExpectedResults Test must not fail
@SYMREQ                 REQ0000
*/
void CT_EUCJP_PACKED_2::TestSplittingConvertingFromUnicodeToEucJpPacked(CCnvCharacterSetConverter& aCharacterSetConverter, TInt aMaximumLengthLowerLimit, TInt aMaximumLengthUpperLimit, TInt aExpectedNumberOfUnicodeCharactersNotConvertedAtSplit, TInt aExpectedLengthOfFirstPartOfEucJpPacked, const TDesC8& aExpectedEucJpPacked, const TDesC16& aOriginalUnicode)
	{
	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-CT-0536 "));
	test(aMaximumLengthLowerLimit<=aMaximumLengthUpperLimit);
	test(aMaximumLengthUpperLimit<=KBufferLength);
	TUint8 eucJpPackedBuffer[KBufferLength];
	for (TInt i=aMaximumLengthLowerLimit; i<=aMaximumLengthUpperLimit; ++i)
		{
		TPtr8 generatedFirstPartOfEucJpPacked(eucJpPackedBuffer, i);
		test(aCharacterSetConverter.ConvertFromUnicode(generatedFirstPartOfEucJpPacked, aOriginalUnicode)==aExpectedNumberOfUnicodeCharactersNotConvertedAtSplit);
		test(generatedFirstPartOfEucJpPacked==aExpectedEucJpPacked.Left(aExpectedLengthOfFirstPartOfEucJpPacked));
		TBuf8<KBufferLength> generatedSecondPartOfEucJpPacked;
		test(aCharacterSetConverter.ConvertFromUnicode(generatedSecondPartOfEucJpPacked, aOriginalUnicode.Right(aExpectedNumberOfUnicodeCharactersNotConvertedAtSplit))==0);
		test(generatedSecondPartOfEucJpPacked==aExpectedEucJpPacked.Mid(aExpectedLengthOfFirstPartOfEucJpPacked));
		TInt state=CCnvCharacterSetConverter::KStateDefault;
		TBuf16<KBufferLength> generatedUnicode;
		test(aCharacterSetConverter.ConvertToUnicode(generatedUnicode, generatedFirstPartOfEucJpPacked, state)==0);
		test(state==CCnvCharacterSetConverter::KStateDefault);
		TBuf16<KBufferLength> generatedSecondPartOfUnicode;
		test(aCharacterSetConverter.ConvertToUnicode(generatedSecondPartOfUnicode, generatedSecondPartOfEucJpPacked, state)==0);
		test(state==CCnvCharacterSetConverter::KStateDefault);
		generatedUnicode.Append(generatedSecondPartOfUnicode);
		test(generatedUnicode==aOriginalUnicode);
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:33,代码来源:t_eucjp_packed_2.cpp

示例3: TokenizeCSV

TBool TAzenqosEngineUtils::TokenizeCSV(const TDesC16& whole,TPtrC16& ret, TPtrC16& remainder, TChar aDelim)
	{
		TPtrC16 afterFristQuote(0,0);

		TBuf<3> aDelimStr;
		aDelimStr.Append(aDelim);

		TInt firstQuotePos = whole.Find(KQuote16);
		TInt CommaPos = whole.Find(aDelimStr);
		TInt secondQuotePos = -1;

		TBool encounteredQuote = EFalse;
		if(firstQuotePos>=0 && firstQuotePos<CommaPos)
		{
			encounteredQuote = ETrue;
			afterFristQuote.Set(whole.Right(whole.Length()-firstQuotePos-1));

			secondQuotePos = afterFristQuote.Find(KQuote16);

			if(secondQuotePos<0)
			{
				TBuf<32> countbuf;
				countbuf =_L("Parse Error: Mis-Quote");
		/*
			CAknErrorNote* informationNote = new (ELeave) CAknErrorNote(ETrue);
	       	informationNote->SetTimeout(CAknNoteDialog::EShortTimeout);
	       	informationNote->ExecuteLD(countbuf);*/
				return EFalse;//misquote
			}

			secondQuotePos += (firstQuotePos+1);
			CommaPos = secondQuotePos+1;



		}
		else
		{
			//csv.Set(incsv);
		}



		if(CommaPos>=0)
		{
			/*if(encounteredQuote)
			{
				ret.Set(incsv.Mid(1,CommaPos-1));
			}
			else
			{

			}*/
			ret.Set(whole.Left(CommaPos));

			if(ret.Length()>=2 && ret[0] == '"' && ret[ret.Length()-1] == '"' )
			{
				if(ret.Length()>2)
				{
					TPtrC16 tmp(0,0);
					tmp.Set(whole.Left(CommaPos));
					ret.Set(tmp.Mid(1,tmp.Length()-2));
				}
				else //ret==2
				{
					ret.Set(0,0);
				}

			}




			remainder.Set(whole.Right(whole.Length()-CommaPos-1));





			return ETrue;
		}


		//remainder.Set(incsv);
		return EFalse;
	}
开发者ID:ykasidit,项目名称:AzqGenUtils,代码行数:86,代码来源:AzenqosEngineUtils.cpp


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