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


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

本文整理汇总了C++中TFileName::LowerCase方法的典型用法代码示例。如果您正苦于以下问题:C++ TFileName::LowerCase方法的具体用法?C++ TFileName::LowerCase怎么用?C++ TFileName::LowerCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TFileName的用法示例。


在下文中一共展示了TFileName::LowerCase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetAssociatedApp

TBool CFileExecuter::GetAssociatedApp( TFileName aFileExtension, TFileName& aAppPath )
{
	TBool aFoundType;

	CCoCoAppUi* nAppUi = (CCoCoAppUi*)(CEikonEnv::Static()->AppUi());
	CDictionaryStore* nlinkStore = nAppUi->Application()->OpenIniFileLC( CEikonEnv::Static()->FsSession() );

	aFileExtension.LowerCase();
	const TUint16* aFileExtensionPtr = aFileExtension.Ptr();

	TUint nDefaultUid = 0;
	TUint nMemberValue;
	for ( TInt i = 0; i < aFileExtension.Length(); i ++ )
	{
		nMemberValue = aFileExtensionPtr[i];
		if ( nMemberValue >= 97 && nMemberValue <= 122 )
		{
			nMemberValue -= 97;
		}
		else if ( nMemberValue >= 48 && nMemberValue <= 57 )
		{
			nMemberValue -= 48;
		}

		nDefaultUid = nDefaultUid* 10 + nMemberValue;
	}


	if ( nlinkStore->IsPresentL( TUid::Uid(nDefaultUid) ) ) 
	{
		RDictionaryReadStream inLinkStoreStream;
		inLinkStoreStream.OpenLC( *nlinkStore, TUid::Uid(nDefaultUid) );
		inLinkStoreStream >> aAppPath;
		CleanupStack::PopAndDestroy();

		aFoundType = true;
	}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:37,代码来源:FileExecuter.cpp

示例2: StopProcessByFullNameL

// ----------------------------------------------------------------------------------------
// CTerminalControlServer::StopProcessByFullNameL
// ----------------------------------------------------------------------------------------
void CTerminalControlServer::StopProcessByFullNameL(const TDesC8& aName) {
    RDEBUG("[CTerminalControlServer]-> StopProcessByFullNameL() >>>");


    TInt rounds = 5;
    TFileName lMatchStr;
    lMatchStr.Copy(aName);
    lMatchStr.LowerCase();

    TBool lIsAbsolute = EFalse;
    if(lMatchStr.LocateReverse(TChar('\\')) != KErrNotFound) {
        lIsAbsolute = ETrue;
    }
    while(rounds--) {
        TInt ret = KErrNone;
        TFullName processName;
        TFindProcess findProcess;

        while(KErrNone == (ret = findProcess.Next(processName))) {
            RProcess process;

            if(KErrNone == (ret = process.Open(findProcess))) {
                RDEBUG("[CTerminalControlServer]-> Process.Open() returned");

                TFileName lStrSource(process.FileName());
                lStrSource.LowerCase();
                if(lIsAbsolute) {
                    RDEBUG("[CTerminalControlServer]-> INFO: The input was specified as an absolute path...");
                    if(lStrSource.Compare(lMatchStr) == 0) {
                        RDEBUG("[CTerminalControlServer]-> Process with correct Filename found => Kill(0) ");
                        process.Kill(0);
                    }
                }
                else {
                    RDEBUG("[CTerminalControlServer]-> INFO: The input was specified as an application name...");
                    TInt lLastDirSepIndex = lStrSource.LocateReverse('\\');
                    TInt lExeIndex = lStrSource.Find(_L(".exe"));
                    if(lLastDirSepIndex < lExeIndex) {
                        TInt lAppNameIndex = lStrSource.Find(lMatchStr);

                        /*
                         * The logic works like this, if the value of lStrSource was 'z:\sys\bin\calendar.exe', lMatchStr would contain calendar
                         * the values of the variables will be as follows
                         * lLastDirSepIndex = 10
                         * lAppNameIndex = 11
                         * lExeIndex = 19
                         *
                         * The below logic would make sure that the right process is killed
                         */
                        if((lAppNameIndex == (lLastDirSepIndex + 1)) && ((lAppNameIndex + lMatchStr.Length()) == lExeIndex)) {
                            RDEBUG("[CTerminalControlServer]-> Process with correct Filename found => Kill(0)");
                            process.Kill(0);
                        }
                    }
                }
            }
            else {
                RDEBUG_2("[CTerminalControlServer]-> Process.Open() returned %d", ret);
            }
        }
        if(KErrNone != ret) {
            RDEBUG_2("[CTerminalControlServer]-> findProcess.Next() returned %d", ret);
        }
    }
    RDEBUG("[CTerminalControlServer]-> StopProcessByFullNameL() <<<");
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:69,代码来源:TerminalControlServer.cpp


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