本文整理汇总了C++中TFileName::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ TFileName::Append方法的具体用法?C++ TFileName::Append怎么用?C++ TFileName::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFileName
的用法示例。
在下文中一共展示了TFileName::Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetDB
void CPodcastModel::ResetDB()
{
DP("CPodcastModel::ResetDB BEGIN");
DropDB();
TFileName dbFileName;
dbFileName.Copy(iSettingsEngine->PrivatePath());
dbFileName.Append(KDBFileName);
// remove the old DB file
if (BaflUtils::FileExists(iFsSession, dbFileName))
{
BaflUtils::DeleteFile(iFsSession, dbFileName);
}
// copy template to new DB
TFileName dbTemplate;
TFileName temp;
dbTemplate.Copy(_L("z:"));
temp.Copy(iSettingsEngine->PrivatePath());
dbTemplate.Append(temp);
dbTemplate.Append(KDBTemplateFileName);
DP1("Copy template DB from: %S", &dbTemplate);
DP1("Copy template DB to: %S", &dbFileName);
BaflUtils::CopyFile(iFsSession, dbTemplate,dbFileName);
iIsFirstStartup = ETrue;
DP("CPodcastModel::ResetDB END");
}
示例2: Initialize
// ==========================================================================
// METHOD: Initialize
//
// DESIGN:
// ==========================================================================
TBool CDebugLogTlsData::Initialize()
{
TInt returnValue = ( iFs.Connect() == KErrNone );
if( returnValue )
{
// Request notification of directory adds/deletes in the logs directory.
iFs.NotifyChange( ENotifyDir, iStatus, KDebugLogsBaseDirectory );
SetActive();
// Dynamically create the name of the log files based on the application name
// and thread ID. This will eliminate multiple processes/thread usage of
// this debug logging infrastructure from scribbling each others traces.
RProcess thisProcess;
RThread thisThread;
// The file name is the process name followed by the thread ID.
TParsePtrC fileNameParser( thisProcess.FileName() );
iFileName.Copy( fileNameParser.Name() );
iFileName.Append( KUnderscore );
iFileName.Append( thisThread.Name() );
iFileName.Append( KDebugLogFileExt );
} // end if
return returnValue;
} // END Initialize
示例3: ClearRemoved
TInt CSimulateMessageServerSession::ClearRemoved()
{
RFs rfs;
User::LeaveIfError(rfs.Connect());
TFileName filename;
// GetAppPath(filename);
// rfs.PrivatePath(filename);
filename.Append(iServer.iPath);
filename.Append(KRemovedDataFile);
RFile file;
TInt err = file.Replace(rfs, filename, EFileWrite);
if (KErrNone != err)
{
return err;
}
CleanupClosePushL(file);
file.Write(KNullDesC8);
CleanupStack::PopAndDestroy(); // file
rfs.Close();
return KErrNone;
}
示例4: WriteDataToFile
TInt CSimulateMessageServerSession::WriteDataToFile(
const RSimMsgDataArray& aArray)
{
RFs rfs;
User::LeaveIfError(rfs.Connect());
TFileName filename;
// GetAppPath(filename);
filename.Append(iServer.iPath);
// rfs.PrivatePath(filename);
filename.Append(KDataFile);
RFile file;
TInt err = file.Replace(rfs, filename, EFileWrite);
if (KErrNone != err)
{
return err;
}
CleanupClosePushL(file);
for (TInt i = 0; i < aArray.Count(); i++)
{
SimMsgData* task = aArray[i];
WriteData(file, *task);
}
CleanupStack::PopAndDestroy(); // file
rfs.Close();
return KErrNone;
}
示例5: QueryRemovedData
void CSimulateMessageServerSession::QueryRemovedData(const RMessage2& aMessage)
{
RFs rfs;
User::LeaveIfError(rfs.Connect());
TFileName filename;
// rfs.PrivatePath(filename);
filename.Append(iServer.iPath);
filename.Append(KRemovedDataFile);
RFile file;
TInt err = file.Open(rfs, filename, EFileRead);
if (KErrNone == err)
{
CleanupClosePushL(file);
//꾸鱗
TInt size;
file.Size(size);
HBufC8* buffer = HBufC8::NewL(size);
TPtr8 ptr = buffer->Des();
file.Read(ptr);
CleanupStack::PopAndDestroy();
aMessage.Write(0,ptr);
delete buffer;
}
rfs.Close();
}
示例6: QueryRemovedLength
void CSimulateMessageServerSession::QueryRemovedLength(const RMessage2& aMessage)
{
RFs rfs;
User::LeaveIfError(rfs.Connect());
TFileName filename;
// rfs.PrivatePath(filename);
filename.Append(iServer.iPath);
filename.Append(KRemovedDataFile);
RFile file;
TInt size = 0;
TInt err = file.Open(rfs, filename, EFileRead);
if (KErrNone == err)
{
CleanupClosePushL(file);
//꾸鱗
file.Size(size);
CleanupStack::PopAndDestroy();
}
rfs.Close();
TBuf8<16> total;
total.AppendNum(size);
aMessage.WriteL(0, total);
}
示例7: ExecuteConfigurationUpdateL
/**
Executes the supported operations specified in the given database
configuration file and updates the settings table to store the
version of this configuration file.
@param aFileData The database file data
@param aMatchingConfigFile The configuration file that is to be processed
@param aDbConfigFileVersion The configuration file version
@param aDbName Logical database name: "main" for the main database or attached database name
@leave KErrNoMemory, if an out of memory condition occurs.
One of the other system-wide error codes if the configuration
file fails to be opened or read.
One of the SQL errors of ESqlDbError type if the update to the
database settings table fails
@panic SqlDb 2 In _DEBUG mode if iDbHandle is NULL (uninitialized TSqlDbSysSettings object).
*/
void TSqlDbSysSettings::ExecuteConfigurationUpdateL(const TSqlSrvFileData& aFileData,
const TDesC& aMatchingConfigFile,
TInt aDbConfigFileVersion,
const TDesC& aDbName)
{
__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
//Execute the specified database config file operations that are supported
#ifdef SYSLIBS_TEST
TDriveUnit drive = EDriveC;
#else
TDriveUnit drive = EDriveZ;
#endif
TFileName configFilePath;
TDriveName drvName = drive.Name();
configFilePath.Append(drvName);
configFilePath.Append(aFileData.PrivatePath());
configFilePath.Append(aMatchingConfigFile);
//If this method leaves then either the config file could not be
//opened or read or an out of memory condition occured. Either way
//another attempt will be made to process the config file when the
//database is next opened
DoExecuteDbConfigFileOpsL(aFileData.Fs(), configFilePath, aDbName);
//Now update the settings table to store the current version of the database config file.
//If this fails then another attempt will be made to process the config file and update
//the settings table when the database is next opened
TBuf<sizeof(KUpdateFileVersionSettingsSql) + KMaxFileName + 10> buf;
buf.Format(KUpdateFileVersionSettingsSql(), &aDbName, aDbConfigFileVersion);
__SQLLEAVE_IF_ERROR(::DbExecStmt16(iDbHandle, buf));
}
示例8: ConstructL
void CSenServiceDispatcher::ConstructL(TInt aConnectionID)
{
iConnectionID = aConnectionID;
ipTransactionsMap = new (ELeave) RTransactionsMap(ETrue, ETrue);
User::LeaveIfError(iCsMessageQueue.CreateLocal());
User::LeaveIfError(iCsSynchronizer.CreateLocal());
User::LeaveIfError(iCsTransctnsMap.CreateLocal());
RProcess process;
TFileName threadName;
threadName.Append( KSenServiceDispatcherThreadName);
threadName.AppendNum( aConnectionID );
threadName.Append( KSenUnderline );
threadName.Append( process.Name().Left(32));
RAllocator& heap = User::Allocator();
User::LeaveIfError(iDispatcherThread.Create(threadName,
TThreadFunction(DispatcherThreadL), KDefaultStackSize, &heap, this));
//Resume the thread so that it should start waiting for any request.
iDispatcherThread.Resume();
//set iDispatchMessages = TRUE so that it should start dispacthing the messages
//when thread gets signaled.
iDispatchMessages = ETrue;
}
示例9: ResolveLogFile
EXPORT_C TInt CTestUtils::ResolveLogFile(const TDesC& aFileName, TParse& aParseOut)
{
TFileName* savedPath = new TFileName;
TFileName* fileName = new TFileName;
if ((savedPath == NULL) || (fileName == NULL))
return KErrNoMemory;
fileName->Append(KMsvPathSep);
fileName->Append(KMsvTestFileOutputBase);
fileName->Append(KMsvPathSep);
// file finder will look in the session drive first, then Y->A,Z
// so set session drive to Y (save old and restore it afterwards)
iFs.SessionPath(*savedPath);
_LIT(KTopDrive,"Y:\\");
iFs.SetSessionPath(KTopDrive);
TFindFile file_finder(iFs);
TInt err = file_finder.FindByDir(*fileName,KNullDesC);
if(err==KErrNone)
{
fileName->Copy(file_finder.File());
AppendTestName(*fileName);
fileName->Append(KMsvPathSep);
fileName->Append(aFileName);
iFs.MkDirAll(*fileName);
aParseOut.Set(*fileName,NULL,NULL);
}
iFs.SetSessionPath(*savedPath);
delete savedPath;
delete fileName;
return(err);
}
示例10: ResolveFile
EXPORT_C TInt CTestConfig::ResolveFile(RFs& aFs, const TDesC& aComponent, const TDesC& aFileName, TParse& aParseOut)
{
TFileName* savedPath = new TFileName;
TFileName* fileName = new TFileName;
if ((savedPath == NULL) || (fileName == NULL))
{
delete savedPath;
delete fileName;
return KErrNoMemory;
}
fileName->Append(KScriptPathSep);
// fileName->Append(KSmsTestFileInputBase);
// fileName->Append(KScriptPathSep);
fileName->Append(aComponent);
fileName->Append(KScriptPathSep);
fileName->Append(aFileName);
// file finder will look in the session drive first, then Y->A,Z
// so set session drive to Y (save old and restore it afterwards)
aFs.SessionPath(*savedPath);
_LIT(KTopDrive,"Y:\\");
aFs.SetSessionPath(KTopDrive);
TFindFile file_finder(aFs);
TInt err = file_finder.FindByDir(*fileName,KNullDesC);
if(err==KErrNone)
aParseOut.Set(file_finder.File(),NULL,NULL);
aFs.SetSessionPath(*savedPath);
delete savedPath;
delete fileName;
return(err);
}
示例11: GetJavaFileNameL
void CStorageManager::GetJavaFileNameL(CSBJavaTransferType* aTransferType, TFileName& aFileName)
/**
Concatenates the name of the backup file from the information found in aTransferType.
@param aTransferType - A CSBJavaTransferType* containing information about the
type of file name that needs be returned.
@param TFilename of the backup file generated in line with the
implemented naming scheme
*/
{
const TDesC& suiteHash = aTransferType->SuiteHashL();
TDriveNumber driveNumber = aTransferType->DriveNumberL();
TJavaTransferType javaType = aTransferType->DataTypeL();
TChar drive;
iTestStep->Fs().DriveToChar(driveNumber, drive);
// we can't create a TSecureID from suiteHash therefore need to duplicate GetSIDPrivateDir Method
GetJavaPrivateDirName(drive, suiteHash, aFileName);
switch(javaType)
{
case EJavaMIDlet:
aFileName.Append(KMidlet);
aFileName.Append(KBackupExtn);
break;
case EJavaMIDletData:
aFileName.Append(KData);
aFileName.Append(KBackupExtn);
break;
}
}
示例12: ConstructL
void CMobiStegoChooseImgView::ConstructL(const TRect& aRect)
{
// Create a window for this application view
CreateWindowL();
indexImg = 0;
// Set the windows size
SetRect(aRect);
list = ListImages::NewL();
CleanupStack::PushL(list);
TFileName dir;
dir.Append(_L("C:\\Data\\images\\"));
list->getImgFiles();
CleanupStack::Pop(1);
TFileName filename;
filename.Append(_L("c:\\Data\\Images\\lokki1.jpg"));
imgEngine = CImageConverterEngine::NewL(this);
CleanupStack::PushL(imgEngine);
imgEngine->StartToDecodeL((list->getImgFiles())[indexImg]);
// Activate the window, which makes it ready to be drawn
CleanupStack::Pop(1);
ActivateL();
}
示例13: ConstructL
void CAlfPerfAppAvkonTestCaseBasic::ConstructL(
CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
{
CAlfPerfAppBaseTestCaseControl::ConstructL( aEnv, aCaseId, aVisibleArea );
iWinRect = aVisibleArea;
iAvkonControl = new(ELeave) CAvkonTestCoeControl();
iAvkonControl->ConstructL(iWinRect);
iAnimTimer = CPeriodic::NewL(CActive::EPriorityStandard);
TFontSpec myFontSpec(_L("Arial"), 3*120);
CCoeEnv::Static()->ScreenDevice()->GetNearestFontInTwips(iFont, myFontSpec);
// Find my private path
TFileName pathWithoutDrive;
TFileName driveAndPath;
CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive );
driveAndPath.Copy(CEikonEnv::Static()->EikAppUi()->Application()->AppFullName().Left(2));
driveAndPath.Append(pathWithoutDrive);
// Create pictures
iPictureBm = new(ELeave) CFbsBitmap;
driveAndPath.Append(_L("alfperfapp_test1.mbm"));
User::LeaveIfError(iPictureBm->Load(driveAndPath));
iMaskBm = new(ELeave) CFbsBitmap;
User::LeaveIfError(iMaskBm->Create(iPictureBm->SizeInPixels(), EGray256));
iTestCaseStartTime_ys.UniversalTime();
iTestCaseFrameCount = 0;
}
示例14: CreateAllDownLoadDir
void CMainControlEngine::CreateAllDownLoadDir(const TDesC& aPath)
{
//创建所有的下载目录
TFileName downloadDir;
downloadDir.Append (GetAppDrive());
downloadDir.Append (_L("\\Data\\"));
RFs& fs = CCoeEnv::Static()->FsSession();
if(!BaflUtils::PathExists(fs,downloadDir))
{
TInt err = fs.MkDir(downloadDir);
User::LeaveIfError(err);
}
downloadDir.Append(_L("CoCo\\"));
if(!BaflUtils::PathExists(fs,downloadDir))
{
TInt err = fs.MkDir(downloadDir);
User::LeaveIfError(err);
}
CreateDir(aPath, KIMAGES1);
CreateDir(aPath, KMUSIC1);
CreateDir(aPath, KAPPS1);
CreateDir(aPath, KVIDEO1);
CreateDir(aPath, KBOOKS1);
CreateDir(aPath, KTOPS1);
CreateDir(aPath, KOTHER1);
}
示例15: fetch_remote_data
char* fetch_remote_data(char* url)
{
char* szData = NULL;
CHttpFileManager* iHttpFileManager = CHttpFileManager::NewL();
if (!gHttpClient)
gHttpClient = CHttpClient::NewL();
if ( iHttpFileManager && gHttpClient )
{
if ( iHttpFileManager->GetFilesCount( ETrue) == 0 ) //currently only one file will be used
{
if ( iHttpFileManager->CreateRequestFile( (const TUint8*)url, strlen(url), NULL, 0 ) )
gHttpClient->InvokeHttpMethodL(CHttpConstants::EGet);
}
TFileName respFile;
iHttpFileManager->GetOldestFile( respFile, EFalse );
if ( respFile.Size() > 0 )
{
TFileName respFilePath;
respFilePath.Append(CHttpConstants::KHttpOUT);
respFilePath.Append(respFile);
szData = iHttpFileManager->ReadResponseFile( respFilePath );
iHttpFileManager->DeleteFile(respFilePath);
}
}
delete iHttpFileManager;
return szData;
}