本文整理汇总了C++中TFileName::AppendNum方法的典型用法代码示例。如果您正苦于以下问题:C++ TFileName::AppendNum方法的具体用法?C++ TFileName::AppendNum怎么用?C++ TFileName::AppendNum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFileName
的用法示例。
在下文中一共展示了TFileName::AppendNum方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}
示例2: ShowL
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
void CPixelMetricsMapperViewContainer::ShowL( const TDesC& aString, TBool& aLast, const TBool& aFileOutput )
{
MDesCArray* itemList = iListbox->Model()->ItemTextArray();
CDesCArray* itemArray = ( CDesCArray* ) itemList;
itemArray->AppendL( aString );
iListbox->HandleItemAdditionL();
iListbox->SetCurrentItemIndex( iCount );
iCount++;
if ( aLast )
{
if (aFileOutput)
{
RFile file;
RFs& fs = CEikonEnv::Static()->FsSession();
TFileName fileName =_L("Layout_");
TRect screenRect;
AknLayoutUtils::LayoutMetricsRect(
AknLayoutUtils::EApplicationWindow,
screenRect );
// Add screen dimensions
TInt height = screenRect.Height();
TInt width = screenRect.Width();
fileName.AppendNum(height);
fileName.Append('_');
fileName.AppendNum(width);
fileName.Append(_L(".txt"));
TInt err=file.Open(fs,fileName,EFileStreamText|EFileWrite|EFileShareAny);
if (err==KErrNotFound) // file does not exist - create it
err=file.Create(fs,fileName,EFileStreamText|EFileWrite|EFileShareAny);
else
file.SetSize(0); //sweep the file
TFileText textFile;
textFile.Set(file);
err = textFile.Seek(ESeekStart);
if (err) User::InfoPrint(_L("File corrupted"));
// Finally loop through all the entries:
TInt idx = 0;
for(;idx!=itemList->MdcaCount();idx++)
{
err = textFile.Write(itemList->MdcaPoint(idx));
if (err) User::InfoPrint(_L("File corrupted"));
}
file.Close();
}
DrawNow();
}
}
示例3: DumpMetaData
void CRefTestAgentImportFile::DumpMetaData(const CMetaDataArray& aMetaDataArray)
{
_LIT(KMetaDataLogFile, "c:\\logs\\rta\\metadata");
_LIT(KExt, ".log");
TInt id(0);
TInt err(KErrNone);
TFileName filename;
RFile file;
do {
filename.SetLength(0);
filename.Append(KMetaDataLogFile);
filename.AppendNum(++id);
filename.Append(KExt);
err = file.Create(iFs,filename,EFileWrite);
} while(err == KErrAlreadyExists);
if(err == KErrNone)
{
for(TInt i=0;i<aMetaDataArray.Count();i++)
{
file.Write(aMetaDataArray[i].Field8());
file.Write(_L8(" "));
file.Write(aMetaDataArray[i].Data8());
file.Write(_L8("\r\n"));
}
file.Close();
}
}
示例4: TestMkDir
static void TestMkDir()
{
test.Next(_L("Benchmark MkDir"));
ClearSessionDirectory();
TTime startTime;
TTime endTime;
TTimeIntervalMicroSeconds timeTaken(0);
startTime.HomeTime();
const TInt KNumDirEntries = 100;
for (TInt n=0; n<KNumDirEntries; n++)
{
TFileName dirName = _L("\\F32-TST\\DIR_");
dirName.AppendNum(n);
dirName.Append(_L("\\"));
TInt r = TheFs.MkDir(dirName);
test_KErrNone(r);
}
endTime.HomeTime();
timeTaken=endTime.MicroSecondsFrom(startTime);
TInt timeTakenInMs = I64LOW(timeTaken.Int64() / 1000);
test.Printf(_L("Time taken to create %d entries = %d ms\n"), KNumDirEntries, timeTakenInMs);
}
示例5: ConstructL
void CSenServiceDispatcher::ConstructL(TInt aConnectionID)
{
iConnectionID = aConnectionID;
ipTransactionsMap = new (ELeave) RTransactionsMap(ETrue, ETrue);
User::LeaveIfError(iCsMessageQueue.CreateLocal());
User::LeaveIfError(iCsSynchronizer.CreateLocal());
User::LeaveIfError(iCsTransctnsMap.CreateLocal());
RProcess process;
TFileName threadName;
threadName.Append( KSenServiceDispatcherThreadName);
threadName.AppendNum( aConnectionID );
threadName.Append( KSenUnderline );
threadName.Append( process.Name().Left(32));
RAllocator& heap = User::Allocator();
User::LeaveIfError(iDispatcherThread.Create(threadName,
TThreadFunction(DispatcherThreadL), KDefaultStackSize, &heap, this));
//Resume the thread so that it should start waiting for any request.
iDispatcherThread.Resume();
//set iDispatchMessages = TRUE so that it should start dispacthing the messages
//when thread gets signaled.
iDispatchMessages = ETrue;
}
示例6: DeleteFromDatabaseL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CScheduleDB::DeleteFromDatabaseL(TInt& aIndex)
{
TFileName QueryBuffer;
QueryBuffer.Copy(_L("SELECT * FROM "));
QueryBuffer.Append(KtxtItemlist);
QueryBuffer.Append(_L(" WHERE "));
QueryBuffer.Append(NCol0);
QueryBuffer.Append(_L(" = "));
QueryBuffer.AppendNum(aIndex);
iItemsDatabase.Begin();
RDbView Myview;
// query buffr with index finds only the selected item row.
Myview.Prepare(iItemsDatabase,TDbQuery(QueryBuffer));
CleanupClosePushL(Myview);
Myview.EvaluateAll();
Myview.FirstL();
// we have autoincrement in index so it should be unique
// but just to make sure, we use 'while', instead of 'if'
while(Myview.AtRow())
{
Myview.GetL();
Myview.DeleteL();
Myview.NextL();
}
CleanupStack::PopAndDestroy(1); // Myview
iItemsDatabase.Commit();
// compacts the databse, by physicaly removig deleted data.
iItemsDatabase.Compact();
}
示例7: UpdateL
EXPORT_C void CCnaConverterList::UpdateL()
/** Requests a rescan of the disk to refresh the list of converters. */
{
// delete old array and populate it with new values
iImplementationArray.ResetAndDestroy();
REComSession::ListImplementationsL(KUidConverterDll16,iImplementationArray);
for (TInt i=0; i<iImplementationArray.Count(); i++)
{ // load the conarc-plugin resource file. This should be set to 1 in
// the ecom resource file to show there is extra file to load
if (iImplementationArray[i]->OpaqueData().Length()!=0 )
{
_LIT(KPath,"z:\\resource\\convert\\");
_LIT(KExtension,".rsc");
TFileName resourceFile;
resourceFile.Copy(KPath);
resourceFile.AppendNum((TInt)iImplementationArray[i]->ImplementationUid().iUid, EHex);
resourceFile.Append(KExtension);
CCnaConvInfoFileReader2* readConverter=CCnaConvInfoFileReader2::NewL(resourceFile);
CleanupStack::PushL(readConverter);
readConverter->RestoreL();
const TInt converterCount = readConverter->Count();
for (TInt j = 0 ; j < converterCount ; j++ )
{
CCnaConverter* tempConv= readConverter->AtL(j);
CleanupStack::PushL(tempConv);
iConverters->AppendL(tempConv);
CleanupStack::Pop(tempConv);
}
CleanupStack::PopAndDestroy(readConverter);
}
}
iDoneScan=ETrue;
}
示例8: UpdateDatabaseL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CScheduleDB::UpdateDatabaseL(CMsgStored* aData)
{
if(aData)
{
TFileName QueryBuffer;
QueryBuffer.Copy(_L("SELECT * FROM "));
QueryBuffer.Append(KtxtItemlist2);
QueryBuffer.Append(_L(" WHERE "));
QueryBuffer.Append(NCol0);
QueryBuffer.Append(_L(" = "));
QueryBuffer.AppendNum(aData->iIndex);
iItemsDatabase.Begin();
RDbView Myview;
Myview.Prepare(iItemsDatabase,TDbQuery(QueryBuffer));
CleanupClosePushL(Myview);
Myview.EvaluateAll();
Myview.FirstL();
if(Myview.AtRow())
{
Myview.UpdateL();
if(aData->iMessage)
Myview.SetColL(2,*aData->iMessage);
Myview.PutL();
}
CleanupStack::PopAndDestroy(1); // Myview
iItemsDatabase.Commit();
}
}
示例9: OpenBDAYVCFAndImportItemL
void CTestImpExvCardSuiteStepBase::OpenBDAYVCFAndImportItemL(TBuf<80> aPath,TInt aIndex)
{
// Format buf to hold relevant vcf file
TFileName fileName;
#ifdef __WINS__
fileName.Append(_L("c:"));
#else
TFileName processFileName = RProcess().FileName();
TParsePtrC parse(processFileName);
fileName.Append(parse.Drive());
#endif
fileName.Append(aPath);
fileName.AppendNum(aIndex);
fileName.Append(_L(".vcf"));
RFs fs;
User::LeaveIfError(fs.Connect()); // push fs
CleanupClosePushL(fs);
RFileReadStream readVCFStream;
User::LeaveIfError(readVCFStream.Open(fs, fileName, EFileRead)); // opens vcf file
TBuf<MAX_TEXT_MESSAGE> message;
message.Format(KOpenVCFFile, &fileName);
INFO_PRINTF1(message);
CleanupClosePushL(readVCFStream); // readVCFStream
ImportBDAYCardL(readVCFStream);
CleanupStack::PopAndDestroy(); // pop readVCFStream
fs.Close();
CleanupStack::PopAndDestroy(); // pop fs
}
示例10: GetTempIconName
// ============================================================================
// CIconConverter::GetTempIconName()
// Get temporary icon name
//
// @since 3.1
// ============================================================================
void CIconConverter::GetTempIconName( TInt aIndex, TFileName& aIconName )
{
_LIT( KIcon, "ICON" );
_LIT( KBmp, ".MBM" );
aIconName.Append( KIcon );
aIconName.AppendNum( static_cast<TInt64>( aIndex ) );
aIconName.Append( KBmp );
}
示例11: MakeFileName
LOCAL_C TInt MakeFileName(TInt aThreadId, TInt aFileNumber, RFs & aFs, TFileName& aName, TBool aMakeDir)
//
// creates a file name and makes all the directory components, if required
//
{
TFileName path;
path.Format(KPath, aThreadId);
TChar driveLetter;
TInt r;
r = aFs.DriveToChar(gDriveNumber, driveLetter);
if (r != KErrNone)
{
LogError(r, KDriveToChar, KNullDesC, driveLetter, 0);
aFs.Close();
return(r);
}
path[0] = (TText) driveLetter;
r = aFs.SetSessionPath(path);
if (r != KErrNone)
{
LogError(r, KSetSessPath, path, 0, 0);
aFs.Close();
return(r);
}
// add additional directories
TInt fileNumber;
fileNumber = aFileNumber;
r = AppendPath(path, fileNumber, 0);
if(r != KErrNone)
{
LogError(r, KAppendPath, path, fileNumber, 0);
aFs.Close();
return(r);
}
if(aMakeDir)
{
r = aFs.MkDirAll(path);
if (r != KErrNone && r != KErrAlreadyExists)
{
LogError(r, KMdAll, path, 0, 0);
aFs.Close();
return(r);
}
}
// and finally add file name
path.Append(KFilePrefix);
path.AppendNum(aFileNumber);
aName = path;
return(KErrNone);
}
示例12: StorePicture
void CZXingBarcodeReaderAppView::StorePicture( TDesC8* aData )
{
// Create path for filename
TFileName path = PathInfo::PhoneMemoryRootPath();
path.Append(PathInfo::ImagesPath());
// Ensure that path exists
BaflUtils::EnsurePathExistsL(iEikonEnv->FsSession(),path);
// Get next free filename for the image
TFileName fileToSave;
TBool fileExists = ETrue;
for (TInt i=1 ; i<100 ; i++)
{
fileToSave.Copy(path);
fileToSave.Append(_L("cw_image_"));
fileToSave.AppendNum(i);
fileToSave.Append(_L(".jpg"));
fileExists = BaflUtils::FileExists(iEikonEnv->FsSession(),fileToSave);
if (!fileExists)
{
break;
}
}
// Save file
if (!fileExists)
{
RFile file;
TInt err = file.Create(iEikonEnv->FsSession(),fileToSave,EFileWrite);
if (!err)
{
file.Write(*aData);
file.Close();
SetTitle(fileToSave);
}
else
{
SetError(_L("File saving error %d"),err);
}
}
else
{
SetTitle(_L("File not saved, delete old pictures!"));
}
}
示例13: DeleteFromDatabaseL
// -----------------------------------------------------------------------------
// CWPInternetAPDB::DeleteFromDatabaseL
// -----------------------------------------------------------------------------
//
TBool CWPInternetAPDB::DeleteFromDatabaseL(TUint aAPId)
{
FLOG( _L( "[Provisioning] CWPInternetAPDB::DeleteFromDatabaseL" ) );
TBool rowsdeleted = EFalse;
TFileName QueryBuffer;
QueryBuffer.Copy(_L("SELECT * FROM "));
QueryBuffer.Append(KtxtItemlist);
QueryBuffer.Append(_L(" WHERE "));
QueryBuffer.Append(NCol2);
QueryBuffer.Append(_L(" = "));
QueryBuffer.AppendNum(aAPId);
iItemsDatabase.Begin();
RDbView Myview;
// query buffer with index finds only the selected item row.
Myview.Prepare(iItemsDatabase, TDbQuery(QueryBuffer));
CleanupClosePushL(Myview);
Myview.EvaluateAll();
if( Myview.FirstL())
{
if (!Myview.IsEmptyL())
{
// we have autoincrement in index so it should be unique
// but just to make sure, we use 'while', instead of 'if'
while (Myview.AtRow())
{
Myview.GetL();
Myview.DeleteL();
Myview.NextL();
}
iItemsDatabase.Commit();
// compacts the databse, by physically removig deleted data.
iItemsDatabase.Compact();
rowsdeleted = ETrue;
}
}
CleanupStack::PopAndDestroy(1); // Myview
FLOG( _L( "[Provisioning] CWPInternetAPDB::DeleteFromDatabaseL: done" ) );
return rowsdeleted;
}
示例14: AppendPath
LOCAL_C TInt AppendPath(TFileName& aPath, TInt aNumber, TInt aLevel)
//
// helper function for MakeFileName()
//
{
if(aNumber > KMaxFilesPerDirectory)
{
aNumber /= KMaxFilesPerDirectory;
AppendPath(aPath, aNumber, aLevel + 1);
}
if(aLevel)
{
aPath.AppendNum(aNumber % KMaxFilesPerDirectory);
aPath.Append('\\');
}
return(KErrNone);
}
示例15: OpenDispatcherLogL
void CSenServiceDispatcher::OpenDispatcherLogL()
{
#ifdef _SENDEBUG
RThread thread;
RProcess process;
TFileName logFile;
logFile.Append( KSenDispactherThreadLog().Left(KSenDispactherThreadLog().Length()-4) ); // exclude ".log" file extension
logFile.AppendNum( iConnectionID );
logFile.Append( KSenUnderline );
logFile.Append( process.Name().Left(32));
logFile.Append( KSenUnderline );
logFile.Append( thread.Name().Left(20));
logFile.Append( KSenDispactherThreadLog().Right(4) ); // postfix with ".log" file extension
// Open connection to the file logger server
TLSLOG_OPEN( KSenDispatcherLogChannel, KSenDispatcherLogLevel, KSenDispactherThread, logFile );
TLSLOG_L(KSenDispatcherLogChannel, KSenDispatcherLogLevel, "CSenServiceDispatcher::ExecuteL - About to create new dispatcher thread..");
TLSLOG_FORMAT((KSenDispatcherLogChannel, KSenDispatcherLogLevel,
_L("- Connection ID: (%d)"), iConnectionID));
#endif
}