本文整理汇总了C++中TFileName::Zero方法的典型用法代码示例。如果您正苦于以下问题:C++ TFileName::Zero方法的具体用法?C++ TFileName::Zero怎么用?C++ TFileName::Zero使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFileName
的用法示例。
在下文中一共展示了TFileName::Zero方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildUserPrivKeyAndUserCertListL
void CPolicyImporter::BuildUserPrivKeyAndUserCertListL()
{
LOG_("-> CPolicyImporter::BuildUserPrivKeyAndUserCertListL()");
delete iCurrUserPrivKeyList;
iCurrUserPrivKeyList = NULL;
iCurrUserPrivKeyList = new (ELeave) CArrayFixFlat<TFileName>(2);
delete iCurrUserCertList;
iCurrUserCertList = NULL;
iCurrUserCertList = new (ELeave) CArrayFixFlat<TFileName>(2);
TFileName *fileName = new (ELeave) TFileName;
CleanupStack::PushL(fileName);
for (TInt i = 0; i < iCurrIkeDataArray->Count(); i++)
{
CIkeData* ikeData = iCurrIkeDataArray->At(i);
fileName->Zero();
if (ikeData->iOwnCert.iData.Length() > 0 &&
ikeData->iOwnCert.iFormat == BIN_CERT)
{
//First check that defined user cert is found and if so
//add the file name to the list
*fileName = iFileUtil.MakeFileName(iImportDir, ikeData->iOwnCert.iData);
if (!iFileUtil.FileExists(*fileName))
{
User::Leave(KVpnErrInvalidUserCertFile);
}
AppendIfNotFoundL( iCurrUserCertList, fileName );
//After the user cert is found check that the assosiated private key
//is found.
if (ikeData->iPrivKey.iData.Length() > 0 &&
ikeData->iPrivKey.iFormat == BIN_CERT)
{
fileName->Zero();
*fileName = iFileUtil.MakeFileName(iImportDir, ikeData->iPrivKey.iData);
if (!iFileUtil.FileExists(*fileName))
{
User::Leave(KVpnErrInvalidUserPrivKeyFile);
}
AppendIfNotFoundL( iCurrUserPrivKeyList, fileName );
}
else
{
User::Leave(KVpnErrInvalidPolicyFile);
}
}
}
CleanupStack::PopAndDestroy(); //fileName
LOG_("<- CPolicyImporter::BuildUserPrivKeyAndUserCertListL()");
}
示例2: BuildPeerCertListL
void CPolicyImporter::BuildPeerCertListL()
{
LOG(Log::Printf(_L8("-> CPolicyImporter::BuildPeerCertListL()\n")));
delete iCurrPeerCertList;
iCurrPeerCertList = NULL;
iCurrPeerCertList = new (ELeave) CArrayFixFlat<TFileName>(2);
TFileName *fileName = new (ELeave) TFileName;
CleanupStack::PushL(fileName);
for (TInt i = 0; i < iCurrIkeDataArray->Count(); i++)
{
CIkeData* ikeData = iCurrIkeDataArray->At(i);
fileName->Zero();
if (ikeData->iPeerCert.iData.Length() > 0 &&
ikeData->iPeerCert.iFormat == BIN_CERT)
{
*fileName = iFileUtil.MakeFileName(iImportDir, ikeData->iPeerCert.iData);
if (!iFileUtil.FileExists(*fileName))
{
User::Leave(KVpnErrPeerCertFileMissing);
}
AppendIfNotFoundL( iCurrPeerCertList, fileName );
}
}
CleanupStack::PopAndDestroy(); //fileName
LOG_("<- CPolicyImporter::BuildPeerCertListL()");
}
示例3: EnterModel
void CFriendLink::EnterModel(TInt atype)
{
// atype += 1;
TBuf<30>temptitle;
temptitle.Zero();
switch(atype)
{
case 0:
{
temptitle.Append(iMainEngine.GetDesById(ECoCoTextRes_MainView_Three));
temptitle.Append(_L("->"));
CNormalListBoxItem& item = (CNormalListBoxItem&)ilistbox->CurItem();
temptitle.Append(item.GetText());
CNewDownload* newdowload = CNewDownload::NewL(this,iMainEngine);
newdowload->titlebuf.Zero();
newdowload->titlebuf.Copy(temptitle);
newdowload->iFirstID = EContentHotDownload;
TInt tempsecondid = ilistbox->CurItemIndex();
newdowload->iSecondID = iMainEngine.GetSynchronContent().GetItemID(EContentHotDownload,tempsecondid,-1);
newdowload->iThirdID = 0;
newdowload->ConstructLater();
newdowload->SetViewType(EContentHotDownload);
this->SetChildWindow(newdowload);
}
break;
case 1:
{
if(iFLinkType==0)
{
iPIndex=ilistbox->CurItemIndex();
this->ChangeFriendLinkList(iPIndex);
}
else
{
TFileName downLoadUrl;
downLoadUrl.Zero();
downLoadUrl.Append(_L("http://59.36.96.182/interface/f?n="));
downLoadUrl.Append(iMainEngine.GetIMEI());
downLoadUrl.Append(_L("&id="));
TInt firstid = EContentFriendLink;
TInt secondid = iPIndex;
TInt thirdid =this->ilistbox->CurItemIndex();
TInt Urlid = iMainEngine.GetSynchronContent().GetItemID(firstid,secondid,thirdid);
downLoadUrl.AppendNum(Urlid);
downLoadUrl.Append(_L("&t="));
downLoadUrl.AppendNum(1);
this->iMainEngine.LaunchWapBrowswerL(downLoadUrl);
}
}
break;
default:
break;
}
}
示例4: OpenFile
void CSearchLocalResultView::OpenFile()
{
TFileName fileName;
fileName.Zero();
fileName.Append(iLocalSearch->GetOneItemPath(this->iSearchList->GetSelectedIndex()));
fileName.Append(iLocalSearch->GetOneItemName(this->iSearchList->GetSelectedIndex()));
iMainEngine.FileExecuter((CWindow*)this).OpenFileByDefault(fileName);
}
示例5: InitCopyToDialog
void CSearchLocalResultView::InitCopyToDialog(const TDesC& aText)
{
TFileName path;
CCopyToDialog* copyToDialog=iMainEngine.ControlFactory().CreateCopyToDialog(*this,aText,this);
for(TInt i=0;i<7;i++)
{
path.Zero();
this->GetCopyToPath(i,path);
copyToDialog->AppendItem(iMainEngine.GetDesById(ETurkeyTextRes_NewSearch_Type1+i),path);
}
this->iSearchList->SetEdwinVisible(EFalse);
}
示例6: ReFreshHandlersL
/*
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
*/
void CEcomHandler::ReFreshHandlersL()
{
iHandlers.ResetAndDestroy();
RImplInfoPtrArray infoArray;
REComSession::ListImplementationsL(KUidYTaskHandUID, infoArray);
TFileName CurrName;
for ( TInt i = 0; i < infoArray.Count(); i++ )
{
CurrName.Zero();
CurrName.Copy(infoArray[i]->DisplayName());
CurrName.TrimAll();
TInt YStart = infoArray[i]->OpaqueData().Find(KtxStrtYTools);
TInt YEnd = infoArray[i]->OpaqueData().Find(KtxEnddYTools);
if(YStart != KErrNotFound
&& YEnd != KErrNotFound)
{
YStart = YStart + KtxStrtYTools().Length();
YEnd = (YEnd - YStart);
if(YEnd > 0 )
{
if(CurrName.Length() && CheckVersionL(infoArray[i]->OpaqueData().Mid(YStart,YEnd)))
{
CHandlerItem* newItem = new(ELeave)CHandlerItem();
CleanupStack::PushL(newItem);
newItem->iUid = infoArray[i]->ImplementationUid();
newItem->iName = CurrName.AllocL();
newItem->iServerName = ParseInfoL(infoArray[i]->OpaqueData().Mid(YStart,YEnd),KtxStrtSERVER,KtxEnddSERVER);
newItem->iIconfile = ParseInfoL(infoArray[i]->OpaqueData().Mid(YStart,YEnd),KtxStrtICONFILE,KtxEnddICONFILE);
CleanupStack::Pop(newItem);
iHandlers.Append(newItem);
}
}
}
}
infoArray.ResetAndDestroy();
}
示例7: GetHandlerL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
CYTasksContainer* CEcomHandler::GetHandlerL(CHandlerItem& aHandler,CEikButtonGroupContainer* aCba)
{
CYTasksContainer* Ret(NULL);
TAny *impl; // pointer to interface implementation
RImplInfoPtrArray infoArray;
REComSession::ListImplementationsL(KUidYTaskHandUID, infoArray);
TFileName CurrName;
for ( TInt i = 0; i < infoArray.Count(); i++ )
{
CurrName.Zero();
CurrName.Copy(infoArray[i]->DisplayName());
CurrName.TrimAll();
if(aHandler.iUid == infoArray[i]->ImplementationUid()
&& CurrName.Length()
&& aHandler.iName)
{
if(CurrName == aHandler.iName->Des())
{
impl = REComSession::CreateImplementationL(infoArray[i]->ImplementationUid(), _FOFF(CYTasksContainer,iDestructorIDKey));
if ( impl )
{
Ret = ((CYTasksContainer*)impl);
Ret->iTasksHandlerExit = iTasksHandlerExit;
CleanupStack::PushL(Ret);
Ret->ConstructL(aCba);
CleanupStack::Pop();//Ret
break;
}
impl = NULL;
}
}
}
infoArray.ResetAndDestroy();
return Ret;
}
示例8: BuildCaCertListL
void CPolicyImporter::BuildCaCertListL()
{
LOG_("-> CPolicyImporter::BuildCaCertListL()");
delete iCurrCaCertList;
iCurrCaCertList = NULL;
iCurrCaCertList = new (ELeave) CArrayFixFlat<TFileName>(2);
TFileName *fileName = new (ELeave) TFileName;
CleanupStack::PushL(fileName);
LOG_("Pre-for");
for (TInt i = 0; i < iCurrIkeDataArray->Count(); i++)
{
LOG_("For start");
CIkeData* ikeData = iCurrIkeDataArray->At(i);
fileName->Zero();
if (ikeData->iCAList)
{
LOG_("CAlist found");
for (TInt j = 0; j < ikeData->iCAList->Count(); j++)
{
LOG_("CA iter start");
if (ikeData->iCAList->At(j)->iFormat == BIN_CERT)
{
LOG_("Bin cert found");
*fileName = iFileUtil.MakeFileName(iImportDir, ikeData->iCAList->At(j)->iData);
if (!iFileUtil.FileExists(*fileName))
{
LOG_("<- CPolicyImporter::BuildCaCertListL() LEAVE (KVpnErrCaCertFileMissing)");
User::Leave(KVpnErrInvalidCaCertFile);
}
//Makes sure every file name is appended only once.
AppendIfNotFoundL( iCurrCaCertList, fileName );
}
}
}
}
CleanupStack::PopAndDestroy(); //fileName
LOG_("<- CPolicyImporter::BuildCaCertListL()");
}
示例9: FilesIdentical
//--------------------------------------------------------------------------
// CLbtContainerAttrFilter::FilesIdentical
//--------------------------------------------------------------------------
//
TBool CLbtContainerAttrFilter::FilesIdentical( TFileName& aTriggerFileName, TFileName& aSystemFileName )
{
FUNC_ENTER("CLbtContainerAttrFilter::FilesIdentical");
if( DoesFileContainePathInfo(aTriggerFileName) )
{
LOG("aTriggerFileName containes path info");
return ( aSystemFileName.CompareC(aTriggerFileName) != KErrNotFound );
}
TFileName triggerFileName;
triggerFileName.Zero();
triggerFileName.Copy(aTriggerFileName);
triggerFileName.Insert(0,_L("\\"));
LOGSTRING( "triggerFileName : \"%S\" ", &triggerFileName );
LOGSTRING( "aSystemFileName: \"%S\" ", &aSystemFileName );
return ( aSystemFileName.FindC( aTriggerFileName ) != KErrNotFound );
}
示例10: ConstructL
// -----------------------------------------------------------------------------
// CSisxUIStartupFile::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CSisxUIStartupFile::ConstructL( const TUid& aUid )
{
User::LeaveIfError( iFileSession.Connect() );
TUidName uidStr = aUid.Name();
TFileName tmp;
iFileSession.PrivatePath( tmp );
tmp.Insert( 0, TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() );
tmp.Append( KImportDir );
tmp.AppendFormat( KNewFileFormat, &uidStr );
iNewFile = tmp.AllocL();
tmp.Zero();
iFileSession.PrivatePath( tmp );
tmp.Insert( 0, TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() );
tmp.Append( KPrivateFileDir );
iFileSession.MkDir( tmp );
tmp.AppendFormat( KPrivateFileFormat, &uidStr );
iPrivateFile = tmp.AllocL();
}
示例11: InitialiseL
void TThreadData::InitialiseL(TInt aIteration, TInt aThreadNum)
{
ASSERT(aIteration >= 0 && aIteration < KMaxIterations);
ASSERT(aThreadNum >= 1 && aThreadNum <= 3);
TInt script = scriptCombinations[aIteration * 3 + aThreadNum - 1];
// Set script file
TDriveUnit sysDrive (RFs::GetSystemDrive());
TDriveName sysdriveName (sysDrive.Name());
TBuf <60> scriptFile (sysdriveName);
scriptFile.Append(scripts[script]);
iScriptFile.Set(scriptFile);
// Set log file
iLogFile.Zero();
TBuf<80> scriptName (sysdriveName);
scriptName.Append(_L("\\tcertstoreconcurrent\\iteration%02d_thread%d_script%d.txt"));
TBuf<80> buf ;
buf.Format(scriptName,aIteration, aThreadNum, script);
iLogFile.Append(buf);
}
示例12: MakeAllInstallPathsL
void CAMPreInstallApp::MakeAllInstallPathsL()
{
#ifdef RD_MULTIPLE_DRIVE
iInstallDocPathArray = new (ELeave) CDesCArrayFlat( 2 );
TDriveList driveList;
TInt driveCount = 0;
//User::LeaveIfError(iFs.Connect() );
User::LeaveIfError( DriveInfo::GetUserVisibleDrives(iFs, driveList,driveCount));
TUint driveStatus = 0;
for (TInt index(0); index < KMaxDrives; index++)
{
if (driveList[index])
{
User::LeaveIfError( DriveInfo::GetDriveStatus(iFs, index,
driveStatus));
TFileName path;
TDriveUnit driveUnit(index);
if ( !(driveStatus & DriveInfo::EDriveRemote ))
{
if (driveStatus & DriveInfo::EDriveRemovable)
{
path.Zero();
path.Append(driveUnit.Name() );
path.Append(KPreInstallPath);
iInstallDocPathArray->AppendL(path);
}
}
}
}
//iFs.Close();
#else
TPtrC mmcDrive(TParsePtrC( PathInfo::MemoryCardRootPath() ).Drive());
iPreInstallDocumentPath.Append(mmcDrive);
iPreInstallDocumentPath.Append(KPreInstallPath);
#endif //RD_MULTIPLE_DRIVE
}
示例13: GetCodeSegInfo
// :FIXME: improve API
TInt DKdaChannel::GetCodeSegInfo(RMinKda::TCodeInfoParams* aParams)
{
RMinKda::TCodeInfoParams params;
umemget32(¶ms, aParams, sizeof(params));
// :FIXME: Currently code segments are always loaded at the same
// location in every address space. Consequently we can ignore
// the PID provided by the client.
DProcess* pP = NULL;
TInt r = KErrNotFound;
TFileName nameBuffer;
nameBuffer.Zero();
Kern::AccessCode();
DCodeSeg* pS = DCodeSeg::VerifyHandle(params.iHandle);
if (pS)
{
TModuleMemoryInfo mmi;
r = pS->GetMemoryInfo(mmi, pP);
if (r == KErrNone)
{
params.iCodeBase = mmi.iCodeBase;
params.iCodeSize = mmi.iCodeSize;
XTRAP(r, XT_DEFAULT, nameBuffer.Append(*(pS->iFileName)));
}
}
Kern::EndAccessCode();
Kern::KUDesPut(*(params.iPathPtr), nameBuffer);
if (r == KErrBadDescriptor)
Kern::PanicCurrentThread(KLitKernExec, ECausedException);
if (r == KErrNone)
umemput32(aParams, ¶ms, sizeof(params));
return r;
}
示例14: getPathL
//================================================================================
//getPathL
//================================================================================
TBool getPathL(TDes& aPath, RFs& aFs)
{
// Generate the folder spec to search in
TFileName searchSpec;
TChar driveLetter = 'C';
searchSpec.Append(driveLetter);
searchSpec.Append(aPath);
CDir* entryList = NULL;
TFindFile finder(aFs);
TInt ret = finder.FindWildByPath(searchSpec, NULL, entryList);
if(ret<KErrNone)
{
//try z drive
driveLetter = 'Z';
searchSpec.Zero();
searchSpec.Append(driveLetter);
searchSpec.Append(aPath);
delete entryList;
entryList = NULL;
ret = finder.FindWildByPath(searchSpec, NULL, entryList);
if (ret < KErrNone)
{
//path not found
delete entryList;
test.Printf(_L("files not found\n"));
return EFalse;
}
}
delete entryList;
//set path
aPath.Copy(searchSpec);
return ETrue;
}
示例15: CreateHeaderFileL
void CPixelMetricsMapperAppUi::CreateHeaderFileL() const
{
// Open/create resulting file.
RFile file;
HBufC* layoutFile = HBufC::NewLC( KMaxFileName );
*layoutFile = KLayoutSourceFileAndPath;
TFileName fileName = *layoutFile;
CleanupStack::PopAndDestroy(layoutFile);
RFs& fs = CEikonEnv::Static()->FsSession();
TInt error = file.Open(fs,fileName, EFileWrite|EFileShareAny|EFileStreamText );
if (error==KErrNotFound)
{
file.Create(fs,fileName, EFileWrite|EFileShareAny|EFileStreamText);
}
CleanupClosePushL( file );
file.SetSize( 0 );
// Make all writes as from textfile.
TFileText textFile;
textFile.Set( file );
textFile.Seek( ESeekStart );
// Take all layout files from private folder.
CDir* dirList;
User::LeaveIfError(fs.GetDir(
KPixelMetricsDataFiles,
KEntryAttMaskSupported,
ESortByName,
dirList));
TMySmallBuffer bufferLayoutHdr;
TMyBigBuffer bufferPMData;
TInt fileCount = dirList->Count();
for (TInt i=0;i<fileCount;i++)
{
// open sourcefile
RFile sourceFile;
TFileName layoutFile = (*dirList)[i].iName;
User::LeaveIfError( sourceFile.Open(
fs,layoutFile, EFileRead|EFileShareAny|EFileStreamText ));
CleanupClosePushL( sourceFile );
// Make all reads as from textfile.
TFileText textSourceFile;
textSourceFile.Set( sourceFile );
TFileName layoutName = CreateLayoutNameL( textSourceFile );
// rewind - just in case.
textSourceFile.Seek( ESeekStart );
TFileName oneline;
bufferLayoutHdr.Append(KOpenBrace);
bufferPMData.Append(KOpenBrace);
TInt loop = 0;
FOREVER
{
if( textSourceFile.Read(oneline) != KErrNone )
{
break;
}
// Add commas for all but first line
if (loop != 0)
{
if ( loop <= KHeaderValues-1)
{
bufferLayoutHdr.Append(KComma);
}
else
{
if (loop != KHeaderValues)
{
bufferPMData.Append(KComma);
}
}
if (loop==KHeaderValues)
{
bufferLayoutHdr.Append(_L(",QLatin1String(\""));
bufferLayoutHdr.Append(layoutName);
bufferLayoutHdr.Append(_L("\")"));
}
}
// Remove pixel metrics name and ":"
oneline = oneline.Mid(oneline.Find(KColon)+1);
// Remove tab
oneline = oneline.Mid(oneline.Find(KTab)+1);
// remove crap from the end of line
TLex lex(oneline);
TInt nextValue = -666;
User::LeaveIfError( lex.Val(nextValue) );
if ( loop <= KHeaderValues-1)
{
bufferLayoutHdr.AppendNum(nextValue);
}
else
{
if (nextValue == -909)
bufferPMData.Append(_L("ECommonStyleValue"));
else
bufferPMData.AppendNum(nextValue);
}
oneline.Zero();
//.........这里部分代码省略.........