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


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

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


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

示例1: bufferPtr

TBool WidgetUnzipUtilityS60::RunUnzipL()
    {
    CZipFileMember* member = iMembers->NextL();
    if (member)
        {
        CleanupStack::PushL(member);
        RZipFileMemberReaderStream* stream;
        User::LeaveIfError(iZipFile->GetInputStreamL(member, stream));
        CleanupStack::PushL(stream);

        HBufC8* buffer = HBufC8::NewLC(member->UncompressedSize());
        TPtr8 bufferPtr(buffer->Des());
        User::LeaveIfError(stream->Read(bufferPtr, member->UncompressedSize()));

        TFileName text;
        text.Copy(*iTempZipPath);
        text.Append(_L('\\'));
        text.Append(*member->Name());

        HBufC* zipedFileNameAndPath = text.AllocLC();

        TInt index = zipedFileNameAndPath->LocateReverse('\\');

        if (index >= 0)
            {
            TPtrC path = zipedFileNameAndPath->Left(index + 1);
            iFs.MkDirAll(path); // errors are ok
            }

        if (zipedFileNameAndPath->Right(1).Compare(_L('\\')) != 0)
            {
            RFile file;
            CleanupClosePushL(file);
            file.Replace(iFs,*zipedFileNameAndPath,EFileWrite);
            User::LeaveIfError(file.Write(*buffer));
            CleanupStack::PopAndDestroy(); // file
            }
        iUncompressedSize += member->UncompressedSize();
        CleanupStack::PopAndDestroy(4);
        return ETrue;
        }
    else
        {
        return EFalse;
        }
    }
开发者ID:vivekgalatage,项目名称:widgetmanager,代码行数:46,代码来源:WidgetUnzipUtilityS60.cpp

示例2: CleanContextInfoLC

HBufC* CMemSpyEngineFileHolder::CleanContextInfoLC( const TDesC& aContext )
    {
    TRACE( RDebug::Print( _L("CMemSpyEngineFileHolder::CleanContextInfoLC() - START - %S"), &aContext ) );
    TFileName fileName;

    TBool seenDoubleColon = EFalse;
    const TInt length = aContext.Length();
    for( TInt i=0; i<length; i++ )
        {
        const TChar c( aContext[ i ] );
        const TBool haveNextChar = ( i+1 < length );
        //
        //TRACE( RDebug::Print( _L("CMemSpyEngineFileHolder::CleanContextInfoLC() - c[%03d]: \'%c\', haveNextChar: %d, seenDoubleColon: %d"), i, (TUint32) c, haveNextChar, seenDoubleColon ) );
        //
        if  ( c == ':' && haveNextChar && aContext[ i + 1 ] == ':' )
            {
            // Skip double colon
            i++;
            fileName.Append( '-' );
            seenDoubleColon = ETrue;
            }
        else if ( c == '.' )
            {
            if  ( seenDoubleColon )
                {
                break;
                }
            else
                {
                fileName.Append( '-' );
                }
            }
        else
            {
            fileName.Append( c );
            }
        }

    TRACE( RDebug::Print( _L("CMemSpyEngineFileHolder::CleanContextInfoLC() - END - %S"), &fileName ) );
    return fileName.AllocLC();
    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:41,代码来源:MemSpyEngineOutputSinkFile.cpp

示例3: ConstructL

/*
-------------------------------------------------------------------------------

    Class: CStifFileParser

    Method: ConstructL

    Description: Symbian OS second phase constructor

    Symbian OS default constructor can leave.

    Sets variables.

    Parameters: RFs& aFs:        in: Handle to valid file server
                RFile& aFile:    in: Handle to the source file
                TBool aIsUnicode in: Is file in unicode format

    Return Values: None

    Errors/Exceptions:  None

    Status: Proposal

-------------------------------------------------------------------------------
*/
void CStifFileParser::ConstructL(RFs& aFs,
                                 RFile& aFile,
                                 TBool aIsUnicode)
	{
	//Initialization
	iFileServer = aFs;
	iBaseFile = aFile;
	iCurrentFile = &aFile;
	iIsUnicode = aIsUnicode;
	iBytesPerChar = iIsUnicode ? 2 : 1;

	//Create file stack (INCLUDE feature)
	iFileStack = new (ELeave) CStackDeprecated<RFile, EFalse>;

	//Add base file to file names array
	TFileName fn;
	iCurrentFile->FullName(fn);
	HBufC* newFile = fn.AllocLC();
	User::LeaveIfError(iFileNames.Append(newFile));
	CleanupStack::Pop(newFile);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:46,代码来源:StifFileParser.cpp

示例4: GenerateFileNameLC

HBufC* CMemSpyEngineFileHolder::GenerateFileNameLC( const TDriveNumber* aForceDrive )
    {
    TFileName name;
    MemSpyEngineUtils::GetFolderL( FsSession(), name, *iMetaData, aForceDrive );
    return name.AllocLC();
    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:6,代码来源:MemSpyEngineOutputSinkFile.cpp


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