本文整理汇总了C++中TFileName::AppendFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ TFileName::AppendFormat方法的具体用法?C++ TFileName::AppendFormat怎么用?C++ TFileName::AppendFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFileName
的用法示例。
在下文中一共展示了TFileName::AppendFormat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConstructL
// -----------------------------------------------------------------------------
// CSisxUIStartupFile::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CSisxUIStartupFile::ConstructL( const TUid& aUid )
{
User::LeaveIfError( iFileSession.Connect() );
TUidName uidStr = aUid.Name();
TFileName tmp;
iFileSession.PrivatePath( tmp );
tmp.Insert( 0, TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() );
tmp.Append( KImportDir );
tmp.AppendFormat( KNewFileFormat, &uidStr );
iNewFile = tmp.AllocL();
tmp.Zero();
iFileSession.PrivatePath( tmp );
tmp.Insert( 0, TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() );
tmp.Append( KPrivateFileDir );
iFileSession.MkDir( tmp );
tmp.AppendFormat( KPrivateFileFormat, &uidStr );
iPrivateFile = tmp.AllocL();
}
示例2: DumpTransferDataL
void CMMCScBkupReadDataTransferRequestBase::DumpTransferDataL( RFs& aFsSession, const TDesC8& aData ) const
{
TPtrC subDirectory( KNullDesC );
//
switch( ElementType() )
{
case EMMCScBkupOwnerDataTypeJavaData:
subDirectory.Set(KMMCScBkupDataTransferDebuggingPathDataJava);
break;
case EMMCScBkupOwnerDataTypeSystemData:
subDirectory.Set(KMMCScBkupDataTransferDebuggingPathDataSystem);
break;
case EMMCScBkupOwnerDataTypePassiveData:
subDirectory.Set(KMMCScBkupDataTransferDebuggingPathDataPassive);
break;
case EMMCScBkupOwnerDataTypeActiveData:
subDirectory.Set(KMMCScBkupDataTransferDebuggingPathDataActive);
break;
default:
User::Leave( KErrNotSupported );
break;
}
//
const TSecureId secureId = DataOwner().SecureId();
_LIT(KMMCScBkupFormatDes, "%S%S");
TFileName transferDumpFileName;
const TDesC& path = PathInfo::MemoryCardRootPath();
transferDumpFileName.Format(KMMCScBkupFormatDes, &path, &KMMCScBkupDataTransferDebuggingPathRoot);
transferDumpFileName.Append( subDirectory );
transferDumpFileName.Append( KMMCScBkupDataTransferDebuggingPathDataRestore );
transferDumpFileName.AppendFormat( KMMCScBkupDataTransferDebuggingFileName, secureId.iId, 'a' + CurrentDrive() );
//
RFile64 file;
TInt error = KErrNone;
TEntry entry;
if ( aFsSession.Entry( transferDumpFileName, entry ) == KErrNone )
{
// Already exists - append data
error = file.Open( aFsSession, transferDumpFileName, EFileWrite | EFileStream | EFileShareExclusive );
}
else
{
entry.iSize = 0;
error = file.Create( aFsSession, transferDumpFileName, EFileWrite | EFileStream | EFileShareExclusive );
}
//
User::LeaveIfError( error );
CleanupClosePushL( file );
error = file.Write( entry.iSize, aData );
CleanupStack::PopAndDestroy( &file );
}
示例3: AddLotsOfFilters
// add 100 filters for enhanced notification test case
void CNotifyWatcher::AddLotsOfFilters()
{
for (TInt i = 0; i < 100; i++)
{
TFileName path;
path.Copy(gTestPath);
path.Append('*');
TFileName file;
file.AppendFormat(_L("*.%3d"), i);
TInt r = iNotify->AddNotification((TUint)TFsNotification::EAllOps, gTestPath, file);
SAFETEST2(r, KErrNone, (iOption & KNotifyTreadIdMask));
}
}
示例4: RunTestCaseL
// start run a test case
void CTestExecutor::RunTestCaseL()
{
RSemaphore smphF;
smphF.CreateLocal(0);
RSemaphore smphN;
smphN.CreateLocal(0);
RArray<RThread> notiThreads; // list of handles of notification threads
RPointerArray<CTimerLogger> loggerList;
TUint16 count = 0;
TUint16 option = iTestSetting.iOption;
while (count < iTestSetting.iNumCli)
{
test(count < 16);
iTestSetting.iOption = (TUint16)(option + count); // Put Thread ID in option
TThreadParam param;
param.iSetting = iTestSetting;
param.iSmphFT = &smphF;
param.iSmphNT = &smphN;
TFileName logName;
logName.FillZ();
if (gPerfMeasure)
{
logName.Append(gLogFilePath);
if (iTestSetting.iNumCli == 1)
logName.Append(_L("SingleClient"));
else
logName.AppendFormat(_L("MultiClient%02d"), count);
logName.Append(gLogPostFix);
}
CTimerLogger* logger = CTimerLogger::NewL(logName);
CleanupStack::PushL(logger);
param.iLogger = logger;
param.iLoggerArray = NULL;
TUint operation = *iTestSetting.iOperationList;
TBool numFilesVaries = EFalse;
if (operation == EOpManyFiles || operation == EOpManyChanges || operation == EOpMixed)
{
numFilesVaries = ETrue;
}
logger->LogSettingDescription(iTestSetting.iNumFiles, iTestSetting.iNumCli, iTestSetting.iOption, numFilesVaries);
loggerList.AppendL(logger);
TBuf<20> threadName;
threadName.AppendFormat(_L("NotificationThread%02d"), count);
RThread notifyOp;
notifyOp.Create(threadName, NotificationOperationThread, KDefaultStackSize, KMinHeapSize, KMaxHeapSize, ¶m);
notiThreads.AppendL(notifyOp);
notifyOp.Resume();
smphF.Wait(); // Wait for the parameters being properly passed
CleanupStack::Pop(logger);
count++;
}
gNotiThreads = notiThreads;
if (iTestSetting.iNumCli == 0) // no notification
{
TFileName logName;
logName.Append(gLogFilePath);
logName.Append(_L("SingleClient"));
logName.Append(gLogPostFix);
CTimerLogger* logger = CTimerLogger::NewL(logName);
CleanupStack::PushL(logger);
logger->LogSettingDescription(iTestSetting.iNumFiles, iTestSetting.iNumCli, iTestSetting.iOption);
loggerList.AppendL(logger);
CleanupStack::Pop(logger);
}
TThreadParam paramFileOp;
paramFileOp.iSetting = iTestSetting;
paramFileOp.iSmphFT = &smphF;
paramFileOp.iSmphNT = &smphN;
paramFileOp.iLogger = NULL;
paramFileOp.iLoggerArray = &loggerList;
RThread fileOp;
fileOp.Create(_L("FileOperationThread"), FileOperationThread, KDefaultStackSize, KMinHeapSize, KMaxHeapSize, ¶mFileOp);
gFileThread = fileOp;
fileOp.Resume();
//.........这里部分代码省略.........