当前位置: 首页>>代码示例>>C++>>正文


C++ TFileName::CompareF方法代码示例

本文整理汇总了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));
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:7,代码来源:settingsclient.cpp

示例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;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:23,代码来源:susutilserver.cpp

示例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();
			}
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:56,代码来源:StifFileParser.cpp

示例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);
//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:101,代码来源:t_sesfs.cpp


注:本文中的TFileName::CompareF方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。