本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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());
}
示例5:
void CYBRecognizer1::FileTypeL(TInt aIndex,TDes& aFileType)
{
switch(aIndex)
{
case 0:
aFileType.Copy(KtxTypeIMageMIF);
break;
case 1:
aFileType.Copy(KtxTypeIMageMBM);
break;
}
}
示例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);
}
}
示例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 <");
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
示例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
}
示例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);
}
示例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;
}
}
}
示例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());
}