本文整理汇总了C++中TDes::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ TDes::Append方法的具体用法?C++ TDes::Append怎么用?C++ TDes::Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDes
的用法示例。
在下文中一共展示了TDes::Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppendScheduleTimeL
EXPORT_C TInt CMsvTestUtils::AppendScheduleTimeL(TMsvId aEntryId, TDes& rOutput)
{
TTime entryTime, schTime;
TTaskInfo info;
TInt err = ScheduleTime(aEntryId, entryTime, schTime, info);
if (!err)
{
TBuf<128> dateString;
entryTime.FormatL(dateString, _L("\tEntry: %D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%.%*C4%:3%+B"));
rOutput.Append(dateString);
schTime.FormatL(dateString, _L("\n\tSched: %D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%.%*C4%:3%+B"));
rOutput.Append(dateString);
rOutput.AppendFormat(_L(" (taskId %d)\n"), info.iTaskId);
}
else
{
rOutput.AppendFormat(_L("\tError %d: Cannot read schedule time for msg %d\n"), err, aEntryId);
}
return err;
}
示例2: AppendFileLength
EXPORT_C void TSTStringFormatter::AppendFileLength(TInt64 aLength, TDes &aLengthStr)
{
if (aLength<0) return;
TInt range;
for (range=0;range<3;++range)
{
if (aLength<1000*1000) break; // keep some digits from fraction
aLength/=1000;
}
#ifdef EKA2
TReal len=aLength;
#else
TReal len=aLength.GetTInt();
#endif
if (len>1000) { len/=1000; ++range; }
if (range==0)
aLengthStr.AppendFormat(_L("%.0f"),len);
else
aLengthStr.AppendFormat(_L("%.1f"),len);
switch (range)
{
case 0: aLengthStr.Append(_L(" B")); break;
case 1: aLengthStr.Append(_L(" kB")); break;
case 2: aLengthStr.Append(_L(" MB")); break;
case 3: aLengthStr.Append(_L(" GB")); break;
case 4: aLengthStr.Append(_L(" TB")); break;
default: __ASSERT_DEBUG(false,User::Panic(_L("#TStringFormatter"),0));
}
}
示例3: getProcessState
// Gets the state and priority of process aproc. Writes state into buffer
//pointed to by aprocstate and returns priority as an integer
int getProcessState(RProcess& aproc,TDes& aprocstate)
{
TExitType exittype;
TProcessPriority prio;
exittype = aproc.ExitType();
prio = aproc.Priority();
switch(exittype)
{
case EExitPending:
aprocstate.Append(_L("R"));
break;
case EExitPanic:
aprocstate.Append(_L("P"));
break;
case EExitKill:
case EExitTerminate:
aprocstate.Append(_L("X"));
return -1;
}
switch(prio)
{
case EPriorityLow:
case EPriorityBackground:
case EPriorityForeground:
aprocstate.Append(_L("N"));
break;
default:
// All other cases
aprocstate.Append(_L("<"));
break;
}
return prio;
}
示例4: AppendDriveLetterToDes
// -----------------------------------------------------------------------------
// Appends drive letter and double colon to a descriptor.
// Path should be zero length when calling this method.
// -----------------------------------------------------------------------------
//
void AppendDriveLetterToDes( const TInt aDrive, TDes& aPath )
{
TChar driveLetter;
RFs::DriveToChar( aDrive, driveLetter );
aPath.Append( driveLetter );
aPath.Append( KAknsSrvDoubleColon );
}
示例5: SkinDirectoryOnDrive
// -----------------------------------------------------------------------------
// Gets skin directory as descriptor based on drive type and array loc.
// -----------------------------------------------------------------------------
//
void CAknsSrvDriveMaster::SkinDirectoryOnDrive(
TAknsSrvSkinDriveList aDriveType,
TInt aLocation,
TDes& aPath ) const
{
AKNS_TRACE_INFO("CAknsSrvDriveMaster::SkinDirectoryOnDrive");
TInt driveNumber = KErrNotFound;
aPath.Zero();
if ( aDriveType == EAknsSrvStaticDrive )
{
if ( iStaticDriveArray.Count() == 0 )
{
return;
}
if ( aLocation >= 0 && aLocation <= iStaticDriveArray.Count() )
{
driveNumber = iStaticDriveArray[ aLocation ];
AppendDriveLetterToDes( driveNumber, aPath );
aPath.Append( KAknSkinSrvPrivateSkinPath );
}
}
else if ( aDriveType == EAknsSrvRemovableDrive )
{
if ( iRemovableDriveArray.Count() == 0 )
{
return;
}
if ( aLocation >= 0 && aLocation <= iRemovableDriveArray.Count() )
{
driveNumber = iRemovableDriveArray[ aLocation ];
AppendDriveLetterToDes( driveNumber, aPath );
aPath.Append( KAknSkinSrvPrivateSkinPath );
}
}
}
示例6: SvgFile
/**
* Return SVG filename.
*/
void CFuiTheme::SvgFile( TDes& aFileName )
{
aFileName.Append( KResourcePath );
aFileName.Append( iName );
aFileName.Append( KMifExt );
aFileName[0] = RProcess().FileName()[0];
}
示例7: PrepareLuidQuery
void CSCOMOAdapterDb::PrepareLuidQuery(TInt aLuid, TDes& aSqlQuery)
{
aSqlQuery.Copy(_L("SELECT * FROM "));
aSqlQuery.Append(KTableAMMgmtObject);
aSqlQuery.Append(_L(" WHERE "));
aSqlQuery.Append(NCol2);
aSqlQuery.Append(_L(" = "));
aSqlQuery.AppendNum(aLuid);
}
示例8: MakePrivateFilenameL
// ---------------------------------------------------------------------------
// CGbaServer::MakePrivateFilenameL()
// ---------------------------------------------------------------------------
//
void CGbaServer::MakePrivateFilenameL(RFs& aFs, const TDesC& aLeafName,
TDes& aNameOut) const
{
aNameOut.Copy(KGBAStoreStandardDrive);
// Get private path
TBuf<KPrivateFilepathLength> privatePath;
aFs.PrivatePath(privatePath);
aNameOut.Append(privatePath);
aNameOut.Append(aLeafName);
}
示例9: GetFullNameAndPath
void CHlpFileEntry::GetFullNameAndPath(TDes& aName) const
{
TChar driveLetter = '?';
RFs::DriveToChar(Drive(), driveLetter);
aName.Zero();
aName.Append(driveLetter);
aName.Append(':');
aName.Append(KHlpFileSearchPath);
aName.Append(FileName());
}
示例10: Print
// ---------------------------------------------------------
// CAreaSearchResult::Print()
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CAreaSearchResult::Print(TDes& aPrint)
{
TChar del(',');
TBuf<KMaxFieldLength> info;
_LIT(KPosInfo, "SouthLat=%g, NortLat=%g, WestLong=%g, EastLong=%g");
info.Format(KPosInfo, iSouthLat, iNorthLat, iWestLong, iEastLong);
aPrint.Append(info);
aPrint.Append(del);
_LIT(KRedefined, "Redefined=%d");
info.Format(KRedefined, iRedefined);
aPrint.Append(info);
aPrint.Append(del);
_LIT(KErrorCode, "ErrorCode = %d");
info.Format(KErrorCode, iErrorCode);
aPrint.Append(info);
aPrint.Append(del);
aPrint.Append(_L("Search result = "));
for (TInt i=0; i<iSearchResult.Count(); i++)
{
_LIT(KSearchResult, "%d");
info.Format(KSearchResult, iSearchResult[i]);
aPrint.Append(info);
aPrint.Append(del);
}
}
示例11: GetCopyToPath
void CSearchLocalResultView::GetCopyToPath(TInt aIndex,TDes& aPath)
{
aPath.Append(iMainEngine.GetAppDrive());
aPath.Append(_L("\\Data\\CoCo\\"));
switch(aIndex)
{
case 0:
aPath.Append(KIMAGES);
break;
case 1:
aPath.Append(KMUSIC);
break;
case 2:
aPath.Append(KAPPS);
break;
case 3:
aPath.Append(KVIDEO);
break;
case 4:
aPath.Append(KAPPS);
break;
case 5:
aPath.Append(KBOOKS);
break;
case 6:
aPath.Append(KTOPS);
break;
}
}
示例12: FormatAtt
void FormatAtt(TDes& aBuffer, const TUint aValue)
{
_LIT(KAttsMsg,"Attributes set are:");
_LIT(KNormal," Normal");
_LIT(KReadOnly," Read-only");
_LIT(KHidden," Hidden");
_LIT(KSystem," System");
_LIT(KVolume," Volume");
_LIT(KDir," Directory");
_LIT(KArchive," Archive");
_LIT(KNewLine,"\n");
aBuffer.Append(KAttsMsg);
if (aValue & KEntryAttNormal)
{
aBuffer.Append(KNormal);
return;
}
if (aValue & KEntryAttReadOnly)
aBuffer.Append(KReadOnly);
if (aValue & KEntryAttHidden)
aBuffer.Append(KHidden);
if (aValue & KEntryAttSystem)
aBuffer.Append(KSystem);
if (aValue & KEntryAttVolume)
aBuffer.Append(KVolume);
if (aValue & KEntryAttDir)
aBuffer.Append(KDir);
if (aValue & KEntryAttArchive)
aBuffer.Append(KArchive);
aBuffer.Append(KNewLine);
}
示例13: GetFileNameForSwpL
/**
Construct a descriptor containing the composite file name from the DLL to load
@param aSwp The swp to create the file name for
@param aLibraryFilename reference to object in which file name is returned
@leave KErrNotFound If the swp is not registered
*/
void CSsmSwpPolicyResolver::GetFileNameForSwpL(const TSsmSwp& aSwp, TDes& aLibraryFilename) const
{
aLibraryFilename.Zero();
aLibraryFilename.Append(KRomDriveLetter);
aLibraryFilename.Append(iSwpPolicyMap->FilenameL(aSwp.Key()));
const TInt postfixLength = KDllFilenamePostfix().Length();
if(KDllFilenamePostfix().CompareF(aLibraryFilename.Right(postfixLength)))
{
aLibraryFilename.Append(KDllFilenamePostfix);
}
}
示例14: NextBackupFileNameL
void CJournalFile::NextBackupFileNameL(TDes& aBackupFileName)
{
TParsePtrC fileNamePtr(iJournalFileName);
aBackupFileName = fileNamePtr.DriveAndPath();
aBackupFileName.Append(fileNamePtr.Name());
aBackupFileName.Append(KPathDelimiter);
aBackupFileName.AppendNumUC(iBackupFilesCount, EHex);
aBackupFileName.Append(KExtDelimiter);
aBackupFileName.Append(KBackupExt);
iBackupFilesCount++;
}
示例15: GetEskFilename
// -----------------------------------------------------------------------------
// Shared by GetBtEskFilename and GetIrdaEskFilename
// -----------------------------------------------------------------------------
static void GetEskFilename( TDes& aBuff, const TDesC& aFileName )
{
TInt maxLen = aBuff.MaxLength();
aBuff.SetLength(maxLen);
::GetModuleFileName(NULL, &(aBuff[0]), maxLen);
aBuff[aBuff.MaxLength() - 1] = 0;
aBuff.SetLength(User::StringLength(aBuff.Ptr()));
aBuff.SetLength(aBuff.LocateReverse('\\') + 1);
aBuff.Append(_L( "z\\private\\101f7989\\ESock\\"));
aBuff.Append(aFileName);
aBuff.ZeroTerminate();
}