本文整理汇总了C++中TFileName类的典型用法代码示例。如果您正苦于以下问题:C++ TFileName类的具体用法?C++ TFileName怎么用?C++ TFileName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TFileName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsRecognizedL
TBool CRefTestAgentManager::IsRecognizedL(RFile& aFile) const
{
TBool result = EFalse;
// Get the name of the file
TFileName fileName;
aFile.Name(fileName);
// Check that the file has content only, otherwise it should
// be put through the supplier API before it can be used
TPtrC extension(fileName.Right(KRtaExtensionContent().Length()));
if(extension.CompareF(KRtaExtensionContent) == 0)
{
result = ETrue;
}
return result;
}
示例2: ErrRet
/*
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
*/
TInt CExPolicy_Server::UpdateStatusL(TBool& aValue, TBool aProtect)
{
TInt ErrRet(KErrNone);
TRAP(ErrRet,
DeleteStatusInfoL();
if(aProtect)
{
iProtectStatus = aValue;
}
else
{
iScreenStatus = aValue;
}
TFileName QueryBuffer;
QueryBuffer.Copy(_L("SELECT * FROM "));
QueryBuffer.Append(KtxtStatuslist);
iItemsDatabase.Begin();
RDbView Myview;
Myview.Prepare(iItemsDatabase,TDbQuery(QueryBuffer));
CleanupClosePushL(Myview);
Myview.EvaluateAll();
Myview.FirstL();
Myview.InsertL();
if(iProtectStatus)
Myview.SetColL(2,0x100);
else
Myview.SetColL(2,0x000);
if(iScreenStatus)
Myview.SetColL(3,0x100);
else
Myview.SetColL(3,0x000);
Myview.PutL();
CleanupStack::PopAndDestroy(1); // Myview
iItemsDatabase.Commit();
);
示例3: CreateDirL
// -----------------------------------------------------------------------------
// CDRM_CAF::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CDRM_CAF::ConstructL()
{
//Read logger settings to check whether test case name is to be
//appended to log file name.
User::LeaveIfError( iFs.Connect() );
// CleanupClosePushL( iFs );
CreateDirL();
RSettingServer settingServer;
TInt ret = settingServer.Connect();
if(ret != KErrNone)
{
User::Leave(ret);
}
// Struct to StifLogger settigs.
TLoggerSettings loggerSettings;
// Parse StifLogger defaults from STIF initialization file.
ret = settingServer.GetLoggerSettings(loggerSettings);
if(ret != KErrNone)
{
User::Leave(ret);
}
// Close Setting server session
settingServer.Close();
TFileName logFileName;
if(loggerSettings.iAddTestCaseTitle)
{
TName title;
TestModuleIf().GetTestCaseTitleL(title);
logFileName.Format(KDRM_CAFLogFileWithTitle, &title);
}
else
{
logFileName.Copy(KDRM_CAFLogFile);
}
iLog = CStifLogger::NewL( KDRM_CAFLogPath,
logFileName,
CStifLogger::ETxt,
CStifLogger::EFile,
EFalse );
SendTestClassVersion();
}
示例4: OverrideTFXEffect
/**
Checks the length of sent variables and does as explained in
RTFXEffect::RegisterTFXEffect() API description
@param aAction The particular transition to set the animation for.
@param aPurpose This override only effects the window/layers owned by the application that have the specified purpose.
@param aResourceDir The name of the directory that contains the animation description files.
@param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition.
Specify KNullDesC for no outgoing phase effect.
@param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition.
Specify KNullDesC for no incoming phase effect.
@param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
*/
void RTFXEffect::OverrideTFXEffect(TFXEffect aCalledFrom, TInt aAction, TInt aPurpose, const TFileName& aResourceDir,
const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags)
{
CheckFileNameAndSetSizes(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
if (CheckCombinedSizeWithCurrentBuffer(sizeof(TWsClCmdOverrideEffect)))
{
TWsClCmdOverrideEffect params(aAction, aPurpose, aResourceDir.Size(), aFilenameOutgoing.Size(), aFilenameIncoming.Size(), aFlags);
Write(¶ms, sizeof(params), iCombSizePaded, (aCalledFrom == ETFXSession ? EWsClOpOverrideEffectBuf : EWsWinOpOverrideEffectBuf));
if (iCombSizePaded > 0)
AppendFileNameData(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
}
else
{
TWsClCmdOverrideEffect params(aAction, aPurpose, aResourceDir.Size(), 0, 0, aFlags);
WriteDataUsingIPC(NULL, ¶ms, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aCalledFrom);
}
}
示例5: CleanupClosePushL
// -----------------------------------------------------------------------------
// CTestDOMApplicationSwitching::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CTestDOMApplicationSwitching::ConstructL()
{
iEnv = CEikonEnv::Static();
//Read logger settings to check whether test case name is to be
//appended to log file name.
RSettingServer settingServer;
CleanupClosePushL( settingServer );
TInt ret = settingServer.Connect();
if ( ret != KErrNone )
{
User::Leave(ret);
}
// Struct to StifLogger settigs.
TLoggerSettings loggerSettings;
// Parse StifLogger defaults from STIF initialization file.
ret = settingServer.GetLoggerSettings( loggerSettings );
if ( ret != KErrNone )
{
User::Leave( ret );
}
// Close Setting server session
settingServer.Close();
CleanupStack::PopAndDestroy( &settingServer );
TFileName logFileName;
if ( loggerSettings.iAddTestCaseTitle )
{
TName title;
TestModuleIf().GetTestCaseTitleL( title );
logFileName.Format( KtestdomapplicationswitchingLogFileWithTitle, &title );
}
else
{
logFileName.Copy( KtestdomapplicationswitchingLogFile );
}
iLog = CStifLogger::NewL( KtestdomapplicationswitchingLogPath,
logFileName,
CStifLogger::ETxt,
CStifLogger::EFile,
EFalse );
SendTestClassVersion();
}
示例6: GetFileName
void CDiscussion::SetDiscussionIdL(const TDesC& aDiscussionId) {
// Rename existing cache file
RFs aSession = CCoeEnv::Static()->FsSession();
TFileName aOldFilePath = GetFileName(aSession);
if(iDiscussionId) {
delete iDiscussionId;
}
iDiscussionId = aDiscussionId.AllocL();
TFileName aNewFilePath = GetFileName(aSession);
if(aNewFilePath.Compare(aOldFilePath) != 0) {
aSession.Rename(aOldFilePath, aNewFilePath);
}
}
示例7: DP
void CSVPHostMountCB::MountL(TBool /*aForceMount*/)
{
DP(_L("** (SVPHOSTMNT) CSVPHostMountCB::MountL()"));
TInt err = iDevice.Open();
User::LeaveIfError(err);
TFileName driveName;
TInt d=Drive().DriveNumber();
iSize=HOST_SVP_DRIVE_SIZE;
User::LeaveIfError(GetVolume(d,driveName,iUniqueID));
HBufC* pN=driveName.AllocL();
DP(_L("** (SVPHOSTMNT) ->SetVolumeName()"));
SetVolumeName(pN);
DP(_L("** (SVPHOSTMNT) <-SetVolumeName()"));
}
示例8: GetStringFromConfig
TVerdict CCreateDrmArchive::doTestStepL()
{
// SetTestStepResult(EInconclusive) is a bad idea.
// It makes the TEST macroes unusable.
TPtrC contentXml;
TPtrC rightsXml;
TPtrC outputFile;
GetStringFromConfig(ConfigSection(),_L("ContentDescription"),contentXml);
GetStringFromConfig(ConfigSection(),_L("RightsDescription"),rightsXml);
GetStringFromConfig(ConfigSection(),_L("OutputFile"),outputFile);
__UHEAP_MARK;
INFO_PRINTF1(_L("Creating DRM archive using the following parameters"));
INFO_PRINTF2(_L(" Content Xml Description : %S"),&contentXml);
INFO_PRINTF2(_L(" Rights Xml Description : %S"),&rightsXml);
INFO_PRINTF2(_L(" Output File : %S"),&outputFile);
// CreateArchive will need to modify the output file name
TFileName outputFileName;
outputFileName.Copy(outputFile);
TBuf8 <KMaxDataTypeLength> mimeType;
TInt err = CRefTestAgentArchive::CreateArchive(contentXml, rightsXml, outputFileName, mimeType);
if(err != KErrNone)
{
INFO_PRINTF3(_L("ERROR: %d, Create Archive \"%S\" failed"), err, &outputFileName);
INFO_PRINTF1(_L(" Check c:\\logs\\rta\\rta.log to make sure input XML is correct and make sure the output file does not already exist"));
SetTestStepResult(EFail);
}
else
{
TBuf <KMaxDataTypeLength> mimeType16;
mimeType16.Copy(mimeType);
INFO_PRINTF1(_L("Drm Archive Created Successfully"));
INFO_PRINTF2(_L(" Mime Type of Output File: %S"),&mimeType16);
INFO_PRINTF2(_L(" Output File Produced : %S"),&outputFileName);
}
__UHEAP_MARKEND;
return TestStepResult();
}
示例9: extensionOnly
void CDbCreator::DoStartL()
{
//process command line arguments
//------------------------------
TBool extensionOnly( EFalse ); //Only extend CommsDat
TBool dump( EFalse ); //Dump is needed not creation
CCommandLineArguments* args = CCommandLineArguments::NewLC();
TFileName fileName;
ParseCommandLineLC( args, fileName, extensionOnly, dump );
CCdcCommsDatCreator* cdc = CCdcCommsDatCreator::NewLC();
//checks filename argument
if ( fileName.Length() == 0 )
{
if( dump )
{
fileName.Copy( KOutFile );
}
else
{
fileName.Copy( KInFile );
}
}
//calls the appropriate function.
if( dump )
{
cdc->DumpCommsDatL( fileName );
}
else if( extensionOnly )
{
cdc->CreateTablesL();
}
else
{
cdc->CreateTablesL();
cdc->CreateCommsDatL( fileName );
}
CleanupStack::PopAndDestroy( 2, args); // args, cdc
}
示例10: DeleteFromDatabaseL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CScheduleDB::DeleteFromDatabaseL(TInt& aIndex)
{
TFileName QueryBuffer;
QueryBuffer.Copy(_L("SELECT * FROM "));
QueryBuffer.Append(KtxtItemlist);
QueryBuffer.Append(_L(" WHERE "));
QueryBuffer.Append(NCol0);
QueryBuffer.Append(_L(" = "));
QueryBuffer.AppendNum(aIndex);
iItemsDatabase.Begin();
RDbView Myview;
// query buffr with index finds only the selected item row.
Myview.Prepare(iItemsDatabase,TDbQuery(QueryBuffer));
CleanupClosePushL(Myview);
Myview.EvaluateAll();
Myview.FirstL();
// we have autoincrement in index so it should be unique
// but just to make sure, we use 'while', instead of 'if'
while(Myview.AtRow())
{
Myview.GetL();
Myview.DeleteL();
Myview.NextL();
}
CleanupStack::PopAndDestroy(1); // Myview
iItemsDatabase.Commit();
// compacts the databse, by physicaly removig deleted data.
iItemsDatabase.Compact();
}
示例11: ConstructL
// -----------------------------------------------------------------------------
// CMmsClientMtmApiTest::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CMmsClientMtmApiTest::ConstructL()
{
//Read logger settings to check whether test case name is to be
//appended to log file name.
RSettingServer settingServer;
TInt ret = settingServer.Connect();
if(ret != KErrNone)
{
User::Leave(ret);
}
// Struct to StifLogger settigs.
TLoggerSettings loggerSettings;
// Parse StifLogger defaults from STIF initialization file.
ret = settingServer.GetLoggerSettings(loggerSettings);
if(ret != KErrNone)
{
User::Leave(ret);
}
// Close Setting server session
settingServer.Close();
TFileName logFileName;
if(loggerSettings.iAddTestCaseTitle)
{
TName title;
TestModuleIf().GetTestCaseTitleL(title);
logFileName.Format(KMmsClientMtmApiTestLogFileWithTitle, &title);
}
else
{
logFileName.Copy(KMmsClientMtmApiTestLogFile);
}
iLog = CStifLogger::NewL( KMmsClientMtmApiTestLogPath,
logFileName,
CStifLogger::ETxt,
CStifLogger::EFile,
EFalse );
iSession = CMsvSession::OpenSyncL(*this);
iMtmRegistry = CClientMtmRegistry::NewL(*iSession);
iClientMtm = (CMmsClientMtm *) iMtmRegistry-> NewMtmL(KUidMsgTypeMultimedia);
SendTestClassVersion();
}
示例12: 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);
}
示例13: memoryType
// -----------------------------------------------------------------------------
// CCapInfo::FolderServiceL()
// Writes folder service. Notice that this service is created in code because
// pathinfo component is used to get folder names.
// -----------------------------------------------------------------------------
//
void CCapInfo::FolderServiceL()
{
TRACE_FUNC_ENTRY;
TBuf<KBufSize> rootPath;
TBuf<KBufSize> memoryType(KNullDesC);
TFileName folderName;
_LIT( KFormat, "%S%S" );
WriteNewLineL();
WriteTagL(EService, TXmlParser::EElementBegin);
WriteValueL(EName, KFolderServiceName);
WriteValueL(EUUID, KFolderServiceUid);
WriteValueL(EVersion, KFolderServiceVersion);
WriteTagL(EObject, TXmlParser::EElementBegin);
WriteValueL(EType, KFolderServiceType);
WriteTagL(EObject, TXmlParser::EElementEnd);
TInt drive;
TInt err;
CapUtil::GetDefaultRootPathL( iFsSession, rootPath );
if( rootPath.Length() > 0 )
{
err = iFsSession.CharToDrive( rootPath[0], drive );
if( err == KErrNone )
{
CapUtil::GetMemoryType( iFsSession, memoryType, drive );
}
}
// EFolderImages
folderName.Format( KFormat, &rootPath, &PathInfo::ImagesPath() );
WriteFolderL( KFolderImages, folderName, memoryType );
// EFolderGraphics
folderName.Format( KFormat, &rootPath, &PathInfo::ImagesPath() );
WriteFolderL(KFolderGraphics, folderName, memoryType);
// EFolderTones
folderName.Format( KFormat, &rootPath, &PathInfo::DigitalSoundsPath() );
WriteFolderL(KFolderTones, folderName, memoryType);
// EFolderMusic
folderName.Format( KFormat, &rootPath, &PathInfo::SoundsPath() );
WriteFolderL(KFolderMusic, folderName, memoryType);
// EFolderVideos
folderName.Format( KFormat, &rootPath, &PathInfo::VideosPath() );
WriteFolderL(KFolderVideos, folderName, memoryType);
// EFolderInstalls
folderName.Format( KFormat, &rootPath, &PathInfo::InstallsPath() );
WriteFolderL(KFolderInstalls, folderName, memoryType);
WriteTagL(EService, TXmlParser::EElementEnd);
WriteNewLineL();
TRACE_FUNC_EXIT;
}
示例14: GetDataL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CImeiSettings::GetDataL(TDes8& aType,TDes8& aData,TDes& aExtension,TInt& aId)
{
aId = iId;
aData.Zero();
if(iListBox)
{
iListBox->StoreSettingsL();
TFileName Hjelpper;
Hjelpper.Copy(iListBox->iType);
Hjelpper.Append(_L("/"));
Hjelpper.Append(iListBox->iTypeId);
aType.Copy(Hjelpper);
aExtension.Copy(iListBox->iExtension);
}
}
示例15: sqlite3_close
EXPORT_C void CPodcastModel::DropDB()
{
if (iDB != NULL)
{
sqlite3_close(iDB);
iDB = NULL;
}
TFileName dbFileName;
dbFileName.Copy(iSettingsEngine->PrivatePath());
dbFileName.Append(KDBFileName);
// remove the old DB file
if (BaflUtils::FileExists(iFsSession, dbFileName))
{
BaflUtils::DeleteFile(iFsSession, dbFileName);
}
}