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


C++ TDes::Copy方法代码示例

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


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

示例1: GetOperatorNameSync

void CPhone::GetOperatorNameSync(TDes& aOperatorName)
	{
	if (IsActive())
		{
		Cancel();
		}
	/*
	CTelephony::TOperatorNameV1Pckg operatorNamePckg(iOpName);
	iTelephony->GetOperatorName(iStatus,operatorNamePckg);
	iFunc = EOperatorName; 
	SetActive();
	StartWait();
	iFunc = ENoneFunc;
	aOperatorName.Copy(iOpName.iOperatorName);
	*/
	CTelephony::TNetworkInfoV1Pckg netInfoPckg(iNetInfo);
	iTelephony->GetCurrentNetworkInfo(iStatus,netInfoPckg);
	iFunc = ECellID;
	SetActive();
	StartWait();
	iFunc = ENoneFunc;
	aOperatorName.Copy(iNetInfo.iShortName);
	if (aOperatorName.Length() == 0)
		{
			aOperatorName.Copy(iNetInfo.iLongName);
		}
		
	}
开发者ID:BwRy,项目名称:core-symbian,代码行数:28,代码来源:Phone.cpp

示例2: GetPartOfConvertedBufferL

/** Gets the specified part of the unicode based on the requirement from the user
@param	aBuffer Pointer to CHtmlToCrtConvBuffer
@param	aPartOfUnicode Contains the return value of GetPartOfBufferL()
@test
*/
void CTestHtmlToCrtConverterBufferStep::GetPartOfConvertedBufferL(CHtmlToCrtConvBuffer* aBuffer, TDes& aPartOfBuffer)
	{
	GetBoolFromConfig(ConfigSection(), KGetPartOfBuffer, iGetPartOfBuffer);
	if ( iGetPartOfBuffer == EFalse )
		{
		return;
		}
		
	GetIntFromConfig(ConfigSection(), KStartPosition, iStartPosition);
	GetIntFromConfig(ConfigSection(), KEndPosition, iEndPosition);
	TPtrC	partOfBufferUnicode;
	if ( iEndPosition == 0 )
		{
		// Gets the part of the buffer from the start position till the end
		aBuffer->GetToEndOfBufferL(partOfBufferUnicode, iStartPosition);
		aPartOfBuffer.Copy(partOfBufferUnicode);	
		}
	else if ( (iStartPosition != 0) && (iEndPosition != 0) )
		{
		// Get the specified part of the buffer returned from CHtmlToCrtConverterBuffer
		aBuffer->GetPartOfBufferL(partOfBufferUnicode, iStartPosition, iEndPosition);
		aPartOfBuffer.Copy(partOfBufferUnicode);
		}
	else if ( iEndPosition != 0 )
		{
		TBuf8<KMaxLengthString>	partOfBufferUnicode;
		// Get the sample of text from the file and returns it in the partOfBufferUnicode
		aBuffer->GetSampleOfTextFromFileL(partOfBufferUnicode, iEndPosition, 0);
		aPartOfBuffer.Copy(partOfBufferUnicode);
		}

	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:37,代码来源:TestHtmlToCrtConverterBufferStep.cpp

示例3: convertStoreNameL

void CntSimStorePrivate::convertStoreNameL(TDes &storeName)
{
    if(storeName.MaxLength() < RMobilePhoneBookStore::KMaxPBIDSize) {
        User::Leave(KErrArgument);
    }

    if (m_storeInfo.m_storeName.isEmpty()) {
        // Default to ADN store
        m_storeInfo.m_storeName = (QLatin1String) KParameterValueSimStoreNameAdn;
        storeName.Copy(KETelIccAdnPhoneBook);
    } else if (m_storeInfo.m_storeName == KParameterValueSimStoreNameFdn) {
        storeName.Copy(KETelIccFdnPhoneBook);
    } else if (m_storeInfo.m_storeName == KParameterValueSimStoreNameAdn) {
        storeName.Copy(KETelIccAdnPhoneBook);
    } else if (m_storeInfo.m_storeName == KParameterValueSimStoreNameSdn) {
        storeName.Copy(KETelIccSdnPhoneBook);
    } else if (m_storeInfo.m_storeName == KParameterValueSimStoreNameOn) {
        storeName.Copy(KETelOwnNumberStore);
    }

    // Check that we got a valid store name
    if(storeName.Length() == 0) {
        User::Leave(KErrArgument);
    }
}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:25,代码来源:cntsimstoreprivate.cpp

示例4: ConstructFilePathByName

//The function constructs a full file path in aFullPath argument (from aDriveNumber, aFileName and aPrivatePath arguments).
//aFullPath must point to a big enough place (ideally TFileName object).
static void ConstructFilePathByName(TDriveNumber aDriveNumber, const TDesC& aFileName, const TDesC& aPrivatePath, TDes& aFullPath)
	{
	TDriveName srcDriveName = TDriveUnit(aDriveNumber).Name();
	aFullPath.Copy(srcDriveName);
	aFullPath.Append(aFileName);
	TParse parse;
	parse.Set(aPrivatePath, &aFullPath, 0);
	aFullPath.Copy(parse.FullName());
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:11,代码来源:test_fileutil.cpp

示例5:

void CYBRecognizer1::FileTypeL(TInt aIndex,TDes& aFileType)
{
	switch(aIndex)	
	{
	case 0:
		aFileType.Copy(KtxTypeIMageMIF);
		break;
	case 1:
		aFileType.Copy(KtxTypeIMageMBM);
		break;
	}
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:12,代码来源:YToolsMBM_MIFRec.cpp

示例6: StrCopy

// -----------------------------------------------------------------------------
// TXmlParser::StrCopy(TDes& aTarget, const TDesC& aSource)
// Function performs string copy with length checking.
// -----------------------------------------------------------------------------
//
void TXmlParser::StrCopy(TDes& aTarget, const TDesC& aSource)
    {
    TInt len=aTarget.MaxLength();
    if(len<aSource.Length()) 
        {
        aTarget.Copy(aSource.Left(len));
        }        
    else
        {
        aTarget.Copy(aSource);
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:17,代码来源:capparser.cpp

示例7: StrCopy

// -----------------------------------------------------------------------------
// CStatusPaneHandler::StrCopy
//
// -----------------------------------------------------------------------------
//
void CStatusPaneHandler::StrCopy( TDes& aTarget, const TDesC& aSource )
    {
    WLOG("CStatusPaneHandler::StrCopy >");
    TInt len = aTarget.MaxLength();
    if( len < aSource.Length() ) 
        {
        aTarget.Copy( aSource.Left(len) );
        return;
        }
    aTarget.Copy( aSource );
    WLOG("CStatusPaneHandler::StrCopy <");
    }
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:17,代码来源:audiofetcherdialogutils.cpp

示例8: ConvertViewTypeToString

/**
 * Converts the view type information in TViewData::TContactViewType to string format 
 */
void TViewData::ConvertViewTypeToString(TViewData::TContactViewType aViewType, TDes& aViewTypeInString)
	{
	if ( aViewType == TViewData::ELocalView )
		{
		aViewTypeInString.Copy(KLocalView);
		}
	else if ( aViewType == TViewData::ERemoteView)
		{
		aViewTypeInString.Copy(KRemoteView);
		}
	else if ( aViewType == TViewData::ENamedRemoteView)
		{
		aViewTypeInString.Copy(KNamedRemoteView);
		}
	else if ( aViewType == TViewData::EGroupView)
		{
		aViewTypeInString.Copy(KGroupView);
		}
	else if ( aViewType == TViewData::EFindView)
		{
		aViewTypeInString.Copy(KFindView);
		}
	else if ( aViewType == TViewData::EFilteredView)
		{
		aViewTypeInString.Copy(KFilteredView);
		}
	else if ( aViewType == TViewData::EConcatenatedView)
		{
		aViewTypeInString.Copy(KConcatenatedView);
		}
	else if ( aViewType == TViewData::ESubView)
		{
		aViewTypeInString.Copy(KSubView);
		}
	}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:38,代码来源:testcontactviewunderlyingviewupdatestep.cpp

示例9: StraightCopy

TInt CImConvertCharconv::StraightCopy( const TDesC8& aBufIn, TDes& rBufOut)
	{
	TInt inLen=aBufIn.Length();
	TInt outMaxLen=rBufOut.MaxLength();

	if (inLen >= outMaxLen)
		{
		TPtrC8 in = aBufIn.Left(outMaxLen);
		rBufOut.Copy(in);
		return (inLen-outMaxLen);
		}
	else
		rBufOut.Copy(aBufIn);
	return 0;
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:15,代码来源:MIUTCONV.CPP

示例10:

void RA3FDevSoundTestBase::SampleRateFromTUintToString(TUint aSampleRate, TDes& aStringSampleRate)
	{
	const TSampleRateToString SampleRateLookUp [] =
	{
	{0x00000001,	KEMMFSampleRate8000Hz() },
	{0x00000002,	KEMMFSampleRate11025Hz()},
	{0x00000004,  	KEMMFSampleRate16000Hz()},
	{0x00000008,	KEMMFSampleRate22050Hz()},
	{0x00000010,	KEMMFSampleRate32000Hz()},
	{0x00000020,	KEMMFSampleRate44100Hz()},
	{0x00000040,	KEMMFSampleRate48000Hz()},
	{0x00000080,	KEMMFSampleRate88200Hz()},
	{0x00000100,	KEMMFSampleRate96000Hz()},
	{0x00000200,	KEMMFSampleRate12000Hz()},
	{0x00000400,	KEMMFSampleRate24000Hz()},
	{0x00000800,	KEMMFSampleRate64000Hz()}
	};

	const TInt length = sizeof SampleRateLookUp / sizeof *SampleRateLookUp;

	for (TInt i =0; i < length; i++)
		{
		if(aSampleRate == SampleRateLookUp[i].iTUIntSampleRate)
			{
			aStringSampleRate.Copy(SampleRateLookUp[i].iTPtrSampleRate);
			return;
			}
		}
		ERR_PRINTF1(_L("SampleRate doesn't match any of the specified sample rates"));
		StopTest(KErrGeneral);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:31,代码来源:char_a3f_devsound_testbase.cpp

示例11: LocationRequestThreadMainPartL

/**
 * Connection is opened to location server,and closed
 *
 * If anything fails during the execution of this test, then function
 * leaves with proper error code.
 *
 * Parameters:
 **/
void LocationRequestThreadMainPartL(TDes& aErrorBuf)
    {
    // Open connection to Location server
    RPositionServer server;

    TInt err = server.Connect(); 

    if (err != KErrNone)
        {
        _LIT(KErrOpen, "Server open failed with code %d\r\n");
        aErrorBuf.Format(KErrOpen, err);
        }
    else
        {
        _LIT(KOkOpen, "Server open ok\r\n");
        aErrorBuf.Copy(KOkOpen);
        }

    User::LeaveIfError(err);

    CleanupClosePushL(server);


    CleanupStack::PopAndDestroy(1); // server, positioner

    _LIT(KInfTestComplet, "Test completed ok for this thread\r\n");
    aErrorBuf.Append(KInfTestComplet);
    }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:36,代码来源:ctlbsclientpostp208.cpp

示例12: TextFieldL

/** 
Retrieve the field text for the given field type and contact item ID.

The behaviour differs when a specific field type is not given i.e. when
aFieldType is KUidContactFieldMatchAll:

- First tries to find an email for the given contact item ID.
- If there is no email then it retrieves the first entry in Fast Access fields
for the given contact item ID.
- If there is no Fast Access fields then it retrieves the first entry in the
text fields blob for the given contact item ID.

Text for all other field types are retrieved from the text fields blob.

The caller must determine that the given contact item ID exists before calling
this method.
*/
void CCntPplViewSession::TextFieldL(RSqlStatement& aSqlStatement, const CCntSqlStatement& aCntSqlStmt, const CContactTemplate& aSystemTemplate, TFieldType aFieldType, TDes& aText)
	{
	TPtrC8 textHeader;
	aSqlStatement.ColumnBinary(aCntSqlStmt.ParameterIndex(KContactTextFieldHeader()), textHeader);
	RDesReadStream textHeaderStream(textHeader);
	CleanupClosePushL(textHeaderStream);	
    CEmbeddedStore* textHeaderStore = CEmbeddedStore::FromLC(textHeaderStream);
    
	RStoreReadStream textHeaderStoreStream;
   	textHeaderStoreStream.OpenLC(*textHeaderStore,textHeaderStore->Root());

	TPtrC textFieldPtrC = aSqlStatement.ColumnTextL(aCntSqlStmt.ParameterIndex(KContactTextFields()));
	HBufC* textFieldsBuf = textFieldPtrC.AllocLC();
	
	if(aFieldType == KUidContactFieldMatchAll)
		{
		if (TCntPersistenceUtility::FindTxtFieldInTextBlobL(textHeaderStoreStream, textFieldsBuf, aSystemTemplate, aFieldType, aText) == EFalse)
			{
			CContactDatabase::TTextFieldMinimal	fastAccessText;
			if (HasTxtFieldInFastAccessFieldsL(aSqlStatement, aCntSqlStmt, fastAccessText))
				{
				aText.Copy(fastAccessText);		
				}
			}
		} 
	else
		{
		if (SpecificTxtFieldInFastAccessFieldsL(aSqlStatement, aCntSqlStmt, aFieldType, aText) == EFalse)
			{
			TCntPersistenceUtility::FindTxtFieldInTextBlobL(textHeaderStoreStream, textFieldsBuf, aSystemTemplate, aFieldType, aText);
			}
		}
		
	CleanupStack::PopAndDestroy(4, &textHeaderStream); //textHeaderStore, textHeaderStream, textHeaderStoreStream, textFieldsBuf
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:52,代码来源:cntpplviewsession.cpp

示例13: GetCPPModuleName

void RTestExecuteLogServ::GetCPPModuleName(TDes& aModuleName, const TText8* aCPPFileName)
/**
 * @return aModuleName - Filename in descriptor
 * @param aCppFileName - Filename
 * Borrowed from scheduletest
 */
	{
	TPtrC8 fileNamePtrC8(aCPPFileName);
	// We do our own filename munging here; TParse can't help us since that's
	// expressly for EPOC filepaths and here we've got whatever the build system is
	// At present Win32 and Unix directory delimiters are supported
	TInt lastDelimiter = Max(fileNamePtrC8.LocateReverse('\\'), fileNamePtrC8.LocateReverse('/'));
	if(lastDelimiter >= 0 && lastDelimiter < fileNamePtrC8.Length() - 1)
		{
		// Found a delimiter which isn't trailing; update the ptr to start at the next char
		TInt fileNameLen = Min(KMaxFilename, fileNamePtrC8.Length() - (lastDelimiter + 1));
		fileNamePtrC8.Set(aCPPFileName + lastDelimiter + 1, fileNameLen);
		}
	else
		{
		// Didn't find a delimiter; take as much of the right-end of the name as fits
		fileNamePtrC8.Set(aCPPFileName + Max(0, fileNamePtrC8.Length() - KMaxFilename), Min(fileNamePtrC8.Length(), KMaxFilename));
		}
	aModuleName.Copy(fileNamePtrC8);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:25,代码来源:client.cpp

示例14: GetEventInformation

// ----------------------------------------------------
// CAlfExCalendarEngine::NumberOfEvents
// ----------------------------------------------------
void CAlfExCalendarEngine::GetEventInformation( 
    const TTime& aDate, 
    TInt aIndex, 
    TDes& aTextBuffer)
    {
    aTextBuffer.Zero();
    TInt count = KErrNotFound;
    TDateTime requestedDate = aDate.DateTime();
    const TInt arrayCount = iCalendarEventArray.Count();
    for(TInt loop = 0; loop < arrayCount; loop++ )
        {
        TDateTime eventDate = iCalendarEventArray[loop].iItemDay.DateTime();
        if(eventDate.Day() == requestedDate.Day() && 
           eventDate.Month() == requestedDate.Month() &&
           eventDate.Year() == requestedDate.Year())
            {
            count++;
            }
        if(aIndex == count)
            {
            aTextBuffer.Copy(iCalendarEventArray[loop].iItemText);
            loop = arrayCount;
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:28,代码来源:alfexcalendarengine.cpp

示例15: ConstructDestPath

//The function constructs a full path in aDestPath argument (from aDriveNumber and aPrivatePath arguments).
//aDestPath must point to a big enough place (ideally TFileName object).
static void ConstructDestPath(TDriveNumber aDriveNumber, const TDesC& aPrivatePath, TDes& aDestPath)
	{
	TDriveName destDriveName = TDriveUnit(aDriveNumber).Name();
	TParse parse;
	parse.Set(aPrivatePath, &destDriveName, 0);
	aDestPath.Copy(parse.FullName());
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:9,代码来源:test_fileutil.cpp


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