本文整理汇总了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;
}
}
示例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();
}
示例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);
}
示例4: GenerateFileNameLC
HBufC* CMemSpyEngineFileHolder::GenerateFileNameLC( const TDriveNumber* aForceDrive )
{
TFileName name;
MemSpyEngineUtils::GetFolderL( FsSession(), name, *iMetaData, aForceDrive );
return name.AllocLC();
}