本文整理汇总了C++中TFileName::CompareF方法的典型用法代码示例。如果您正苦于以下问题:C++ TFileName::CompareF方法的具体用法?C++ TFileName::CompareF怎么用?C++ TFileName::CompareF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFileName
的用法示例。
在下文中一共展示了TFileName::CompareF方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StoreSettingL
void CSettingsClient::StoreSettingL(const TDesC& aCategory,const TDesC& aName,const TFileName& aValue)
{
TFileName old;
TInt err=iSettings.Get(aCategory,aName,old);
if(err!=KErrNotFound) User::LeaveIfError(err);
if(err==KErrNotFound||old.CompareF(aValue)) User::LeaveIfError(iSettings.Set(aCategory,aName,aValue));
}
示例2: IndexOf
/**
Check if a Utility Plugin is already loaded.
@param A RLibrary based on the DLL file which we want to investigate if its already
included in iLoadedPlugins.
@return The index of any CSusPluginFrame in iLoadedPlugins which is based on the same DLL file
as given in parameter aLibrary.
@internalComponent
@released
*/
TInt CSusUtilServer::IndexOf(const RLibrary& aLibrary, TInt aNewLOrdinal) const
{
const TFileName nameToLookFor = aLibrary.FileName();
const TInt count = iLoadedPlugins.Count();
for(TInt i=0; i<count; i++)
{
if(0 == nameToLookFor.CompareF(iLoadedPlugins[i]->FileName()) && aNewLOrdinal == iLoadedPlugins[i]->NewLOrdinal())
{
return i;
}
}
return KErrNotFound;
}
示例3: PopFromFileStack
/*
-------------------------------------------------------------------------------
Class: CStifFileParser
Method: PopFromFileStack
Description: Pops RFile handle from file stack and sets correct current file handle
Parameters: None
Return Values: None
Errors/Exceptions: None
Status: Proposal
-------------------------------------------------------------------------------
*/
void CStifFileParser::PopFromFileStack(void)
{
if(!iFileStack->IsEmpty())
{
//Pop from stack
iCurrentFile = iFileStack->Pop();
TFileName fn;
iCurrentFile->FullName(fn);
//And remove from file names array
for(TInt i = iFileNames.Count() - 1; i >= 0; i--)
{
if(fn.CompareF(iFileNames[i]->Des()) == KErrNone)
{
delete iFileNames[i];
iFileNames.Remove(i);
break;
}
}
__TRACE(KInfo, (_L("Closing file [%S]"), &fn));
//Close file
iCurrentFile->Close();
delete iCurrentFile;
//Set correct current file
if(iFileStack->IsEmpty())
{
iCurrentFile = &iBaseFile; //base file, because stack is empty
}
else
{
iCurrentFile = iFileStack->Last();
}
}
}
示例4: testSubst
void TSessionTest::testSubst()
//
// Test the substitute functions.
//
{
test.Printf(_L("Test subst"));
TVolumeInfo v;
TInt r=iFs.Volume(v);
test_KErrNone(r);
TDriveInfo origDI;
r=iFs.Drive(origDI);
test_KErrNone(r);
TDriveInfo driveInfo;
r=iFs.Drive(driveInfo,EDriveO);
test_KErrNone(r);
testSetVolume();
if (driveInfo.iDriveAtt==KDriveAttLocal)
{
return; // Subst local drives fails
}
TFileName n;
r=iFs.Subst(n,EDriveO);
test_KErrNone(r);
test(n.Length()==0);
r=iFs.SetSubst(gTestSessionPath,EDriveO);
test_KErrNone(r);
r=iFs.Subst(n,EDriveO);
test_KErrNone(r);
test(n==gTestSessionPath);
TVolumeInfo w;
r=iFs.Volume(w,EDriveO);
test_KErrNone(r);
test(w.iDrive.iType==v.iDrive.iType);
test(w.iDrive.iConnectionBusType==v.iDrive.iConnectionBusType);
test(w.iDrive.iDriveAtt==KDriveAttSubsted);
test(w.iDrive.iMediaAtt==v.iDrive.iMediaAtt);
test(w.iUniqueID==v.iUniqueID);
if(v.iDrive.iType != EMediaRam) // We can't assume that RAM disk will be the same size since last recorded...
{
test(w.iSize==v.iSize);
// If this test is being run under windows using drive C then skip free space comparison
// as it is likely to fail as the windows file system is unlike to have static freespace
#ifdef __WINS__
if(User::UpperCase(gTestSessionPath[0]) != 'C')
{
#endif
test(w.iFree==v.iFree);
#ifdef __WINS__
}
#endif
}
test(w.iName==v.iName);
TDriveList driveList;
r=iFs.DriveList(driveList);
test_KErrNone(r);
test(driveList[EDriveO]==KDriveAttSubsted);
TDriveInfo d;
r=iFs.Drive(d,EDriveO);
test_KErrNone(r);
test(d.iDriveAtt==KDriveAttSubsted);
test(d.iMediaAtt==origDI.iMediaAtt);
test(d.iType==origDI.iType);
test(d.iConnectionBusType==origDI.iConnectionBusType);
test.Next(_L("Test real name"));
r=iFs.RealName(_L("O:\\FILE.XXX"),n);
test_KErrNone(r);
TFileName substedPath=gTestSessionPath;
substedPath.Append(_L("FILE.XXX"));
test(n.CompareF(substedPath)==KErrNone);
//
test.Next(_L("Test MkDir, Rename and RmDir on Substed drive"));
_LIT(KTurgid,"turgid\\");
TFileName dir=gTestSessionPath;
dir+=KTurgid;
r=iFs.MkDirAll(dir);
test_KErrNone(r);
dir+=_L("subdir\\");
r=iFs.MkDir(dir);
test_KErrNone(r);
r=iFs.RmDir(_L("O:\\turgid\\subdir\\"));
test_KErrNone(r);
r=iFs.Rename(_L("O:\\turgid"), _L("O:\\facile"));
test_KErrNone(r);
r=iFs.MkDir(_L("O:\\insipid\\"));
test_KErrNone(r);
r=iFs.Rename(_L("O:\\insipid"), _L("O:\\glib"));
test_KErrNone(r);
r=iFs.RmDir(_L("O:\\facile\\"));
test_KErrNone(r);
//.........这里部分代码省略.........