本文整理汇总了C++中TParse::FullName方法的典型用法代码示例。如果您正苦于以下问题:C++ TParse::FullName方法的具体用法?C++ TParse::FullName怎么用?C++ TParse::FullName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TParse
的用法示例。
在下文中一共展示了TParse::FullName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateandOpenL
// -----------------------------------------------------------------------------
// CWPInternetAPDB::CreateandOpenL
// -----------------------------------------------------------------------------
//
void CSCOMOAdapterDb::CreateandOpenL(TParse& name)
{
TInt err;
#ifdef SYMBIAN_SECURE_DBMS
iDatabase.Create(iRdbSession, name.FullName(), KDBMSSecureID);
#else
if( SysUtil::FFSSpaceBelowCriticalLevelL( &iFsSession, KEmptyDbSizeEstimate ) )
{
User::Leave( KErrDiskFull );
}
iDatabase.Create(iFsSession, name.FullName());
#endif
CreateTableL(iDatabase);
iDatabase.Close();
#ifdef SYMBIAN_SECURE_DBMS
err = iDatabase.Open(iRdbSession, name.FullName(), KDBMSSecureID);
#else
err = iDatabase.Open(iFsSession, DBFileName);
#endif
//Debug
if (err != KErrNone)
{
User::LeaveIfError(err);
}
}
示例2: ScanDirL
LOCAL_C void ScanDirL(RFs& aFs, const TDesC& aDir)
{
User::After(1000000);
TParse parse;
parse.Set(_L("t_*.exe"), &aDir, NULL);
TPtrC spec(parse.FullName());
test.Start(parse.DriveAndPath());
TFindFile find(aFs);
CDir* dir;
if (!find.FindWildByPath(parse.FullName(), NULL, dir))
{
CleanupStack::PushL(dir);
for(int i = 0; i < dir->Count(); i++)
{
parse.Set((*dir)[i].iName, &spec, NULL);
if (i == 0)
test.Start(parse.FullName());
else
test.Next(parse.FullName());
LaunchAndWaitL(parse.FullName());
}
CleanupStack::PopAndDestroy(); // dir
}
test.End();
}
示例3: DirectFileL
/**
@SYMTestCaseID SYSLIB-STORE-CT-3350
@SYMTestCaseDesc Direct file store verification test
@SYMTestPriority High
@SYMTestActions Open a corrupted direct store file
@SYMTestExpectedResults the function called leaves with KErrNotSupported
@SYMDEF DEF100757
*/
LOCAL_C void DirectFileL()
{
Test.Next(_L(" @SYMTestCaseID:SYSLIB-STORE-CT-3350 Creating Direct File Store "));
TDriveUnit drive(static_cast<TUint>(RFs::GetSystemDrive()));
TParse parse;
parse.Set(drive.Name(), &KTestDirectFileName, NULL);
// create a direct file store
TheStore=CDirectFileStore::ReplaceLC(TheFs,parse.FullName(),EFileWrite);
TheStore->SetTypeL(TheStore->Layout());
TInt8 val=100;
TStreamId id=TheSink.CreateL(*TheStore);
TheSink<<val;
TheSink.Close();
TheStore->SetRootL(id);
TheStore->CommitL();
CleanupStack::PopAndDestroy(TheStore);
// corrupt the store file
RFile file;
User::LeaveIfError(file.Open(TheFs,parse.FullName(),EFileWrite));
CleanupClosePushL(file);
User::LeaveIfError(file.Write(KTestJunkData,sizeof(TCheckedUid)));
CleanupStack::PopAndDestroy(&file);
// the CDirectFileStore::OpenLC should leave if passed the corrupted store file name
TheStore = NULL;
TRAPD(r, \
{\
TheStore=CDirectFileStore::OpenLC(TheFs,parse.FullName(),EFileRead);\
CleanupStack::PopAndDestroy(TheStore); \
}\
);
示例4: AddResourceFileL
// -----------------------------------------------------------------------------
// CSecModUIModel::AddResourceFileL()
// -----------------------------------------------------------------------------
//
void CSecModUIModel::AddResourceFileL()
{
LOG_ENTERFN("CSecModUIModel::AddResourceFileL()");
// Resource file loading
RFs& fs = iEikEnv->FsSession();
TFileName fileName;
TParse parse;
// secmodui.rsc
parse.Set(KResourceFile, &KDC_RESOURCE_FILES_DIR, NULL);
fileName = parse.FullName();
BaflUtils::NearestLanguageFile( fs, fileName );
iResourceFileOffset = iEikEnv->AddResourceFileL( fileName );
// CertManUI.rsc
parse.Set(KResourceFile2, &KDC_RESOURCE_FILES_DIR, NULL);
fileName = parse.FullName();
BaflUtils::NearestLanguageFile( fs, fileName );
iResourceFileOffset2 = iEikEnv->AddResourceFileL( fileName );
// CTSecDlg.rsc
parse.Set(KResourceFile3, &KDC_RESOURCE_FILES_DIR, NULL);
fileName = parse.FullName();
BaflUtils::NearestLanguageFile( fs, fileName );
iResourceFileOffset3 = iEikEnv->AddResourceFileL( fileName );
LOG_LEAVEFN("CSecModUIModel::AddResourceFileL()");
}
示例5: ThreadTestL
void ThreadTestL(TInt aThread)
{
RFs fs;
User::LeaveIfError(fs.Connect());
CleanupClosePushL(fs);
TDriveUnit drive(static_cast<TUint>(RFs::GetSystemDrive()));
TParse testIniFile;
testIniFile.Set(drive.Name(), &KTestIniFile, NULL);
TIniData data;
CDictionaryStore* dict=CDictionaryFileStore::OpenLC(fs,testIniFile.FullName(),KTestUid);
data.LoadL(*dict);
CleanupStack::PopAndDestroy(); // dict
TParse threadTestPath;
threadTestPath.Set(drive.Name(), &KThreadTestPath, NULL);
TFileName name;
name.Format(threadTestPath.FullName(),aThread);
dict=CDictionaryFileStore::OpenLC(fs,name,KTestUid);
data.SaveL(*dict);
dict->CommitL();
CleanupStack::PopAndDestroy();
TReal x=0.501;
for (TInt ii=0;ii<1000;++ii)
x=4.0*x*(1.0-x);
dict=CDictionaryFileStore::OpenLC(fs,name,KTestUid);
data.LoadL(*dict);
CleanupStack::PopAndDestroy(); // dict
fs.Delete(name);
CleanupStack::PopAndDestroy(); // fs
}
示例6: ConstructL
// ----------------------------------------------------------------------------
// Symbian 2nd phase constructor can leave.
// ----------------------------------------------------------------------------
//
void CWrtHarvester::ConstructL()
{
User::LeaveIfError( iApaSession.Connect() );
iWidgetUIListener = CWrtHarvesterPSNotifier::NewL( this, EWidgetUIState );
iWidgetRegListener = CWrtHarvesterPSNotifier::NewL( this, EWidgetRegAltered );
User::LeaveIfError( iFs.Connect() );
iWidgetUsbListener = CWrtUsbHandler::NewL( this, iFs );
iWidgetUsbListener->Start();
SetMSMode(0);
TFileName resourceFileName;
TParse parse;
Dll::FileName (resourceFileName);
parse.Set(KResourceFileName, &resourceFileName, NULL);
resourceFileName = parse.FullName();
CCoeEnv* coeEnv = CCoeEnv::Static();
BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceFileName);
if ( !BaflUtils::FileExists( coeEnv->FsSession(), resourceFileName ) )
{
// Use resource file on the Z drive instead
parse.Set( KResourceDir, &KDC_RESOURCE_FILES_DIR, NULL );
resourceFileName = parse.FullName();
BaflUtils::NearestLanguageFile( coeEnv->FsSession(),resourceFileName );
}
iResourceFileOffset = coeEnv->AddResourceFileL(resourceFileName);
}
示例7: ScanDirectory
void CStateDownload::ScanDirectory(RFs& aFs, const TDesC& aDir, const TDesC& aWild, CDesCArray* aFilesArray)
{
TParse parse;
parse.Set(aWild, &aDir, NULL);
TPtrC spec(parse.FullName());
TFindFile FindFile(aFs);
CDir* dir;
if (FindFile.FindWildByPath(parse.FullName(), NULL, dir) == KErrNone)
{
CleanupStack::PushL(dir);
TInt count=dir->Count();
for(TInt i = 0; i < count; i++)
{
parse.Set((*dir)[i].iName, &spec, NULL);
TEntry entry;
if(aFs.Entry(parse.FullName(),entry) == KErrNone)
{
if(!entry.IsDir())
{
//InsertIsqL raises a KErrAlreadyExists (-11) when inserting a duplicate
TRAPD(err,aFilesArray->InsertIsqL(parse.FullName()));
}
}
}
CleanupStack::PopAndDestroy(dir);
}
}
示例8: OkToExitL
TBool CFileSelectDialog::OkToExitL(TInt aButton)
{
TInt selected=ListBox()->CurrentItemIndex();
_LOGDATA(_L("Selected: %d"),selected);
if (aButton==EAknSoftkeyCancel){return ETrue;}
if (iCurrentPath.Compare(_L(""))==0)
{
_LOG(_L("(iCurrentPath.Compare(_L(""))==0)"));
_LOG(iCurrentPath);
iCurrentPath.Append(iArray->MdcaPoint(selected));
iCurrentPath.Append(_L("\\"));
if (BaflUtils::PathExists(iFs,iCurrentPath)){Update();Show();return EFalse;}
//Update();
}
else if ((selected>1&&iType==EFolder)||(selected>0&&iType==EFile))
{
_LOG(_L("((selected>1)&&(iCurrentPath.Compare(_L(""))!=0))"));
_LOG(iCurrentPath);
TBuf<255> temp(iArray->MdcaPoint(selected));
TChar c1='[',c2=']';
if (temp[0]==c1&&temp[temp.Length()-1]==c2) {temp.Copy(temp.Left(temp.Length()-1));temp.Copy(temp.Right(temp.Length()-1));}
_LOGDATA(_L("Temp: %S"),&temp);
iCurrentPath.Append(temp);
iCurrentPath.Append(_L("\\"));
_LOGDATA(_L("CurrPath after append: %S"),&iCurrentPath);
CEikonEnv::Static()->InfoMsg(iCurrentPath);
User::After(500000);
if (BaflUtils::PathExists(iFs,iCurrentPath)){Update();Show();return EFalse;}
else if (BaflUtils::FileExists(iFs,iCurrentPath.Left(iCurrentPath.Length()-1)))
{
iResult.Copy(iCurrentPath.Left(iCurrentPath.Length()-1));
return ETrue;
}
}
else if (selected==0)
{
_LOG(_L("(selected==0&&(iCurrentPath.Compare(_L(""))!=0))"));
_LOG(iCurrentPath);
TParse p;
iFs.Parse(iCurrentPath, p);
_LOG(_L("Will pop now"))
TInt err=p.PopDir();
if (err!=KErrNone||iCurrentPath.Compare(p.FullName())==0){iCurrentPath.Copy(_L(""));}
else {iCurrentPath.Copy(p.FullName());}
//if (iCurrentPath.Compare(_L(""))!=0)
Update();Show();return EFalse;
}
else if (selected==1&&iType==EFolder&&(iCurrentPath.Compare(_L(""))!=0))
{
_LOG(_L("Will update result"));
iResult.Copy(iCurrentPath);
return ETrue;
}
Update();Show();return EFalse;
}
示例9: ClearSessionDirectory
void static ClearSessionDirectory()
//
// Delete the contents of F32-TST
//
{
TParse sessionPath;
TInt r=TheFs.Parse(_L("\\F32-TST\\"),_L(""),sessionPath);
test_KErrNone(r);
RecursiveRmDir(sessionPath.FullName());
r=TheFs.MkDir(sessionPath.FullName());
test_KErrNone(r);
}
示例10: ContentionTestL
/**
@SYMTestCaseID SYSLIB-STORE-CT-1191
@SYMTestCaseDesc Lock out of dictionary files test
@SYMTestPriority High
@SYMTestActions Attempt for opening of same dictionary file.Tests for file in use error
@SYMTestExpectedResults Test must not fail
@SYMREQ REQ0000
*/
void ContentionTestL()
{
test.Start(_L(" @SYMTestCaseID:SYSLIB-STORE-CT-1191 Contention tests "));
TDriveUnit drive(static_cast<TUint>(RFs::GetSystemDrive()));
TParse testIniFile;
testIniFile.Set(drive.Name(), &KTestIniFile, NULL);
CDictionaryStore* dict=CDictionaryFileStore::OpenLC(TheFs,testIniFile.FullName(),KTestUid);
TIniData data;
data.SaveL(*dict);
CleanupStack::PopAndDestroy(); // dict
test.Next(_L("Lock-out test"));
CDictionaryFileStore::OpenLC(TheFs,testIniFile.FullName(),KTestUid);
TUint tick=User::TickCount();
TRAPD(r,CDictionaryFileStore::OpenL(TheFs,testIniFile.FullName(),KTestUid));
tick=User::TickCount()-tick;
test (r==KErrInUse);
test.Printf(_L("Lock-out discovered: %d ticks\r\n"),tick);
CleanupStack::PopAndDestroy();
test.Next(_L("Creating threads"));
RThread threads[KNumThreads];
TRequestStatus status[KNumThreads];
TInt ii;
for (ii=0;ii<KNumThreads;++ii)
{
TName name;
name.Format(_L("Test_%d"),ii);
test (threads[ii].Create(name,ThreadTest,KThreadStack,KThreadHeap,KThreadHeapMax,(TAny*)ii,EOwnerThread)==KErrNone);
threads[ii].SetPriority(EPriorityLess);
threads[ii].Logon(status[ii]);
test (status[ii]==KRequestPending);
}
for (ii=0;ii<KNumThreads;++ii)
threads[ii].Resume();
test.Next(_L("Waiting for completion"));
for (ii=0;ii<KNumThreads;++ii)
User::WaitForAnyRequest();
TInt success=0;
for (ii=0;ii<KNumThreads;++ii)
{
test (status[ii]!=KRequestPending);
if (status[ii].Int()==KErrNone)
++success;
}
test.Printf(_L("Thread success: %d of %d\r\n"),success,KNumThreads);
test.End();
}
示例11: DoIt
TInt DoIt()
{
TInt r;
r=Source.Open(Fs,SourceName.FullName(),EFileRead);
if(r!=KErrNone)
return r;
r = Destination.Replace(Fs,DestinationName.FullName(),EFileWrite);
if(r!=KErrNone)
return r;
TUint8* buffer;
const TInt KBufferSize = 0x10000;
buffer = (TUint8*)User::Alloc(KBufferSize);
if(!buffer)
return KErrNoMemory;
TPtr8 p(buffer,KBufferSize,KBufferSize);
TInt n = 0;
while (r==KErrNone)
{
r = Source.Read(p);
if(r!=KErrNone || p.Size()==0)
break;
if (n==0)
{
// first block contains header
if ((TUint)p.Size() < sizeof(E32ImageHeader))
{
r = KErrCorrupt;
break;
}
E32ImageHeader* h = (E32ImageHeader*)buffer;
r = SetCap(h);
}
if (r==KErrNone)
r = Destination.Write(p);
++n;
}
delete buffer;
Source.Close();
Destination.Close();
return r;
}
示例12: FindAndOpenDefaultResourceFileLC
// -----------------------------------------------------------------------------
// CbsUtils::FindAndOpenDefaultResourceFileLC
// Searches and opens the DLL default resource file.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CbsUtils::FindAndOpenDefaultResourceFileLC(
RFs& aFs,
RResourceFile& aResFile )
{
// default resource file path
_LIT(KDirAndFile,"z:CbsServer.rsc");
TParse* fp = new(ELeave) TParse();
fp->Set(KDirAndFile, &KDC_RESOURCE_FILES_DIR, NULL);
static const TInt KDefResFileSignature = 4;
// Find the resource file
TFileName fileName( fp->FullName() );
BaflUtils::NearestLanguageFile( aFs, fileName );
// Open the resource file
aResFile.OpenL( aFs, fileName );
// Push close operation in tbe cleanup stack
CleanupClosePushL( aResFile );
aResFile.ConfirmSignatureL( KDefResFileSignature );
delete fp;
}
示例13: ExistsL
// -----------------------------------------------------------------------------
// CbsUtils::ExistsL
// Returns ETrue, if the file aFile exists.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
TBool CbsUtils::ExistsL(
const RFs& aFs,
const TDesC& aFile )
{
TParse filename;
aFs.Parse( aFile, filename );
TBool returnCode( EFalse );
TUint attributes;
TInt result( aFs.Att( filename.FullName(), attributes ) );
if ( result == KErrNone )
{
returnCode = ETrue;
}
else if ( result == KErrNotFound )
{
returnCode = EFalse;
}
else
{
User::Leave( result );
}
return returnCode;
}
示例14: TestAddBifL
void CSmsSendRecvTest::TestAddBifL(const TDesC& aBifName)
{
iSmsTest.Printf(_L("\tAdd BIF: %S\n"), &aBifName);
RFs& fs = iSmsTest.FileSession();
TInt err = fs.MkDir(KBifDir);
if (err != KErrAlreadyExists)
User::LeaveIfError(err);
TParse fileOut;
err = iSmsTest.ResolveFile(KSmsComponent, aBifName, fileOut);
if (err)
{
iSmsTest.Printf(_L("Test BIF %S not found! Continuing without this test\n"), &aBifName);
return;
}
CFileMan* fileMan = CFileMan::NewL(fs);
CleanupStack::PushL(fileMan);
err = fileMan->Copy(fileOut.FullName(), KBifDir);
if (err != KErrAlreadyExists)
User::LeaveIfError(err);
CleanupStack::PopAndDestroy(fileMan);
User::After(KBifWait);
}
示例15: doInternalizeL
LOCAL_C void doInternalizeL(const TDesC& aName)
{
TParse filestorename;
fsSession.Parse(aName,filestorename);
// construct file store object - specifying the file
// containing the store.
CFileStore* store = CDirectFileStore::OpenLC(fsSession,filestorename.FullName(),EFileRead);
// Construct a CCompound object
// from the root stream created earlier.
CCompound* thecompound = CCompound::NewL(*store,store->Root());
// Show contents of the CCompound object (and its
// components)
_LIT(KTxtRestoredContent,"... Restored CCompound content.");
doShow(KTxtRestoredContent,*thecompound);
// destroy the store object (this also closes the file
// containing the store)
CleanupStack::PopAndDestroy();
// Now destroy the CCompound object
delete thecompound;
}