本文整理汇总了C++中TFileName::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ TFileName::Copy方法的具体用法?C++ TFileName::Copy怎么用?C++ TFileName::Copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFileName
的用法示例。
在下文中一共展示了TFileName::Copy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OkToAddToValDb
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
TBool CExPolicy_Server::OkToAddToValDb(RDbDatabase& aDatabase,const TDesC& aCode,const TDesC8& aString)
{
TBool Ret(ETrue);
TFileName QueryBuffer;
QueryBuffer.Copy(_L("SELECT * FROM "));
QueryBuffer.Append(KtxtVallist);
RDbView Myview;
Myview.Prepare(aDatabase,TDbQuery(QueryBuffer));
CleanupClosePushL(Myview);
Myview.EvaluateAll();
Myview.FirstL();
QueryBuffer.Copy(aString);
while(Myview.AtRow()) // Just delete one instance of the message
{
Myview.GetL();
if(QueryBuffer == Myview.ColDes(3)
&& aCode == Myview.ColDes(2))
{
Ret = EFalse;
break;
}
Myview.NextL();
}
CleanupStack::PopAndDestroy(1); // Myview
return Ret;
}
示例2: AddToValDatabase
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CExPolicy_Server::AddToValDatabase(RDbDatabase& aDatabase,const TDesC& aCode,const TDesC8& aString)
{
TFileName QueryBuffer;
QueryBuffer.Copy(_L("SELECT * FROM "));
QueryBuffer.Append(KtxtVallist);
aDatabase.Begin();
RDbView Myview;
Myview.Prepare(aDatabase,TDbQuery(QueryBuffer));
CleanupClosePushL(Myview);
Myview.InsertL();
Myview.SetColL(2,aCode);
QueryBuffer.Copy(aString);
Myview.SetColL(3,QueryBuffer);
Myview.PutL();
CleanupStack::PopAndDestroy(1); // Myview
aDatabase.Commit();
}
示例3: ResetDB
void CPodcastModel::ResetDB()
{
DP("CPodcastModel::ResetDB BEGIN");
DropDB();
TFileName dbFileName;
dbFileName.Copy(iSettingsEngine->PrivatePath());
dbFileName.Append(KDBFileName);
// remove the old DB file
if (BaflUtils::FileExists(iFsSession, dbFileName))
{
BaflUtils::DeleteFile(iFsSession, dbFileName);
}
// copy template to new DB
TFileName dbTemplate;
TFileName temp;
dbTemplate.Copy(_L("z:"));
temp.Copy(iSettingsEngine->PrivatePath());
dbTemplate.Append(temp);
dbTemplate.Append(KDBTemplateFileName);
DP1("Copy template DB from: %S", &dbTemplate);
DP1("Copy template DB to: %S", &dbFileName);
BaflUtils::CopyFile(iFsSession, dbTemplate,dbFileName);
iIsFirstStartup = ETrue;
DP("CPodcastModel::ResetDB END");
}
示例4: ConstructL
void CCompare::ConstructL(const TTestActionSpec& aTestActionSpec)
{
CKeyStoreTestAction::ConstructL(aTestActionSpec);
TInt err = KErrNone;
TInt pos = 0;
TDriveUnit sysDrive (RFs::GetSystemDrive());
TBuf<128> ramDrive (sysDrive.Name());
ramDrive.Append(_L("\\tkeystore\\data\\"));
iOriginalFile = ramDrive;
iNewFile = ramDrive;
TFileName buf;
buf.FillZ();
buf.Copy(Input::ParseElement(aTestActionSpec.iActionBody,
KOriginalFile,
KOriginalFileEnd, pos, err));
// Now the filename itself
iOriginalFile.Append(buf);
buf.Copy(Input::ParseElement(aTestActionSpec.iActionBody,
KNewFile,
KNewFileEnd, pos, err));
// Now the filename itself
iNewFile.Append(buf);
// iExpectedResult = SetExpectedResultL(Input::ParseElement(aTestActionSpec.iActionResult,
// KReturnStart,
// KReturnEnd, pos, err));
}
示例5: ImportPlaylistsL
void CEmTubePlaylistManager::ImportPlaylistsL()
{
TFileName fileName;
RFile file;
RFs session;
session.Connect();
CleanupClosePushL( session );
#ifndef __WINS__
TParsePtrC parse( CEikonEnv::Static()->EikAppUi()->Application()->AppFullName() );
fileName.Copy( parse.Drive() );
TPath privateDir;
User::LeaveIfError( session.PrivatePath( privateDir ) );
fileName.Append( privateDir );
#else
fileName.Copy( _L("C:\\Data\\") );
#endif
fileName.Append( KPlaylistsFilename );
TInt err = file.Open( session, fileName, EFileStream | EFileRead );
CleanupClosePushL( file );
if( err == KErrNone )
{
RFileReadStream stream( file );
CleanupClosePushL( stream );
TInt count = stream.ReadInt32L();
for( TInt i=0;i<count;i++)
{
CEmTubePlaylist *pl = CEmTubePlaylist::NewL( stream );
iPlaylists.Append( pl );
}
CleanupStack::PopAndDestroy( &stream );
}
if( iPlaylists.Count() == 0 )
{
HBufC* name = StringLoader::LoadLC( R_PLAYLIST_MOST_PLAYED_TXT );
AddPlaylistL( *name, CEmTubePlaylist::EPlaylistInternal );
CleanupStack::PopAndDestroy( name );
name = StringLoader::LoadLC( R_PLAYLIST_RECENTLY_PLAYED_TXT );
AddPlaylistL( *name, CEmTubePlaylist::EPlaylistInternal );
CleanupStack::PopAndDestroy( name );
name = StringLoader::LoadLC( R_PLAYLIST_RECENTLY_SAVED_TXT );
AddPlaylistL( *name, CEmTubePlaylist::EPlaylistInternal );
CleanupStack::PopAndDestroy( name );
}
CleanupStack::PopAndDestroy( &file );
CleanupStack::PopAndDestroy( &session );
}
示例6: Init
void CTangramAnimation::Init()
{
TFileName file;
#ifndef __WINS__
file.Copy(KTangramImage);
CompleteWithAppPath(file);
#else
file.Copy(KResourceDirction);
file.Append(KTangramImage);
#endif
iBitmapArray->LoadDataFromFile(file);
}
示例7: ReadFilesL
void CAknFileSettingPage::ReadFilesL(const TDesC* aPos)
{
TInt pos=-1;
iFiles->Reset();
FileControl()->Reset();
TFileName buffer;
if(iFileValue.Length())
{
buffer.Copy(KFolderIcon);
buffer.Append(KFolderUp);
iFiles->AppendL(buffer);
TParse parse;
parse.SetNoWild(iFileValue,NULL,NULL);
CDir* list;
User::LeaveIfError(iFs.GetDir(parse.DriveAndPath(),KEntryAttMaskSupported,ESortByName|EDirsFirst,list));
CleanupStack::PushL(list);
for(TInt i=0; i<list->Count(); i++)
{
const TDesC& name=(*list)[i].iName;
if((*list)[i].IsDir())
{
buffer.Copy(KFolderIcon);
}
else
{
if(name.MatchF(KMelodyMask1)<0&&name.MatchF(KMelodyMask2)<0&&name.MatchF(KMelodyMask3)<0&&name.MatchF(KMelodyMask4)<0) continue;
buffer.Copy(KMelodyIcon);
}
buffer.Append(name);
if(aPos&&name.MatchF(*aPos)>=0) pos=iFiles->Count();
iFiles->AppendL(buffer);
}
CleanupStack::PopAndDestroy(); //list
}
else
{
TDriveList drives;
User::LeaveIfError(iFs.DriveList(drives));
for(TInt drive=EDriveA; drive<=EDriveZ; drive++)
{
if(drives[drive])
{
buffer.Copy(KFolderIcon);
buffer.Append(drive+'a');
buffer.Append(':');
iFiles->AppendL(buffer);
}
}
}
FileControl()->HandleItemAdditionL();
if(pos!=-1) FileControl()->SetCurrentItemIndexAndDraw(pos);
UpdateFileL();
}
示例8: ConstructL
/**
* @brief Completes the second phase of Symbian object construction.
* Put initialization code that could leave here.
*/
void Csymbian_ua_guiAppUi::ConstructL()
{
// [[[ begin generated region: do not modify [Generated Contents]
BaseConstructL (EAknEnableSkin);
InitializeContainersL();
// ]]] end generated region [Generated Contents]
// Create private folder
RProcess process;
TFileName path;
path.Copy (process.FileName().Left (2));
if (path.Compare (_L ("c")) || path.Compare (_L ("C")))
CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC);
else if (path.Compare (_L ("e")) || path.Compare (_L ("E")))
CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE);
// Init PJSUA
if (symbian_ua_init() != 0) {
symbian_ua_destroy();
Exit();
}
ExecuteDlg_wait_initLD();
CTimer::ConstructL();
CActiveScheduler::Add (this);
After (4000000);
}
示例9: ReadDbItemsL
void CExPolicy_Server::ReadDbItemsL(TBool aImsi)
{
TFileName QueryBuffer;
QueryBuffer.Copy(_L("SELECT * FROM "));// just get all columns & rows
if(aImsi)
QueryBuffer.Append(KtxtImsilist);
else
QueryBuffer.Append(KtxtNumberlist);
RDbView Myview;
Myview.Prepare(iItemsDatabase,TDbQuery(QueryBuffer));
CleanupClosePushL(Myview);
Myview.EvaluateAll();
Myview.FirstL();
while(Myview.AtRow()) // Just delete one instance of the message
{
Myview.GetL();
TExampleItem NewItem;
NewItem.iIndex = Myview.ColInt(1);
NewItem.iName.Copy(Myview.ColDes(2));
NewItem.iValue.Copy(Myview.ColDes(3));
if(aImsi)
iImsiArray.Append(NewItem);
else
iNumberArray.Append(NewItem);
Myview.NextL();
}
CleanupStack::PopAndDestroy(1); // Myview
}
示例10: Initialize
// ==========================================================================
// METHOD: Initialize
//
// DESIGN:
// ==========================================================================
TBool CDebugLogTlsData::Initialize()
{
TInt returnValue = ( iFs.Connect() == KErrNone );
if( returnValue )
{
// Request notification of directory adds/deletes in the logs directory.
iFs.NotifyChange( ENotifyDir, iStatus, KDebugLogsBaseDirectory );
SetActive();
// Dynamically create the name of the log files based on the application name
// and thread ID. This will eliminate multiple processes/thread usage of
// this debug logging infrastructure from scribbling each others traces.
RProcess thisProcess;
RThread thisThread;
// The file name is the process name followed by the thread ID.
TParsePtrC fileNameParser( thisProcess.FileName() );
iFileName.Copy( fileNameParser.Name() );
iFileName.Append( KUnderscore );
iFileName.Append( thisThread.Name() );
iFileName.Append( KDebugLogFileExt );
} // end if
return returnValue;
} // END Initialize
示例11: 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;
}
示例12: AddDNL
void CListCertificates::AddDNL(const TDesC8& aDNBuf)
{
if (aDNBuf.Length())
{
RFs fs;
User::LeaveIfError(fs.Connect());
CleanupClosePushL(fs);
TFileName fn;
fn.Copy(aDNBuf);
RFile file;
file.Open(fs, fn, EFileRead);
CleanupClosePushL(file);
TInt size;
file.Size(size);
HBufC8* cert = HBufC8::NewMaxLC(size);
TPtr8 ptr(cert->Des());
file.Read(ptr);
CX509Certificate* parsedCert = CX509Certificate::NewLC(*cert);
HBufC8* issuer = parsedCert->DataElementEncoding(CX509Certificate::EIssuerName)->AllocLC();
User::LeaveIfError(iDNs.Append(issuer));
CleanupStack::Pop(issuer);
CleanupStack::PopAndDestroy(4, &fs);
}
}
示例13: doTestStepL
TVerdict CDumpDrmArchive::doTestStepL()
{
// SetTestStepResult(EInconclusive) is a bad idea.
// It makes the TEST macroes unusable.
TPtrC fileName;
TPtrC outputPath;
GetStringFromConfig(ConfigSection(),_L("Filename"),fileName);
GetStringFromConfig(ConfigSection(),_L("outputpath"),outputPath);
__UHEAP_MARK;
INFO_PRINTF2(_L("Reading DRM archive: %S "), &fileName);
RFs fs;
User::LeaveIfError(fs.Connect());
CleanupClosePushL(fs);
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
RFile64 file;
#else
RFile file;
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
User::LeaveIfError(file.Open(fs, fileName, EFileRead | EFileStream | EFileShareReadersOnly));
CleanupClosePushL(file);
CRefTestAgentArchive* archive = CRefTestAgentArchive::NewL(file);
CleanupStack::PushL(archive);
TBuf <256> mimeType;
mimeType.Copy(archive->DefaultMimeType());
INFO_PRINTF2(_L("Default Mime Type : %S "), &mimeType);
CDrmFiles& drmFiles = archive->DrmFilesL();
// enhance this later
// just dump out the default content object
CDrmFileContent& defaultContent = drmFiles.FindL(KDefaultContentObject());
TBuf8 <1024> buffer;
TInt length = 1024;
TFileName outputFileName;
outputFileName.Copy(outputPath);
outputFileName.Append(_L("output.txt"));
RFile outputFile;
User::LeaveIfError(outputFile.Create(fs, outputFileName, EFileWrite | EFileStream | EFileShareAny));
CleanupClosePushL(outputFile);
while(length > 0)
{
User::LeaveIfError(defaultContent.Read(buffer, buffer.MaxLength()));
length = buffer.Length();
User::LeaveIfError(outputFile.Write(buffer));
}
CleanupStack::PopAndDestroy(4, &fs); // fs, file, archive, outputFile
__UHEAP_MARKEND;
return TestStepResult();
}
示例14: AppendMainLogL
TInt CTestUtils::AppendMainLogL()
{
_LIT(KDisplayLogFile,"Log File %S\n");
TParse loglocation;
TFileName logfile;
TInt err=ResolveLogFile(KNullDesC, loglocation);
if(err!=KErrNone)
{
iFs.MkDirAll(KMsvTestFileDefaultOutputBase);
err=ResolveLogFile(KNullDesC, loglocation);
}
User::LeaveIfError(err);
logfile.Copy(loglocation.FullName());
logfile.Delete(logfile.Length()-1,1);
AppendVariantName(logfile);
iRTest.Printf(KDisplayLogFile, &logfile);
iFs.MkDirAll(logfile);
iLogBuf=HBufC::NewL(KMaxLogLineLength);
iLogBuf8=HBufC8::NewL(KMaxLogLineLength);
TInt pos=0;
TInt ret=KErrNone;
ret=iFile.Open(iFs,logfile,EFileWrite|EFileShareAny);
if (ret==KErrNotFound)
ret=iFile.Create(iFs,logfile,EFileWrite|EFileShareAny);
if (ret==KErrNone)
return(iFile.Seek(ESeekEnd,pos));
else
return(ret);
}
示例15: OpenMainLogL
TInt CTestUtils::OpenMainLogL()
{
_LIT(KDisplayLogFile,"Log File %S\n");
TParse loglocation;
TFileName logfile;
TInt err=ResolveLogFile(KNullDesC, loglocation);
if(err!=KErrNone)
{
TChar driveChar=RFs::GetSystemDriveChar();
TBuf<2> systemDrive;
systemDrive.Append(driveChar);
systemDrive.Append(KDriveDelimiter);
TPath pathName(systemDrive) ;
pathName.Append(KMsvTestFileDefaultOutputBase);
iFs.MkDirAll(pathName);
err=ResolveLogFile(KNullDesC, loglocation);
}
User::LeaveIfError(err);
logfile.Copy(loglocation.FullName());
logfile.Delete(logfile.Length()-1,1);
AppendVariantName(logfile);
iRTest.Printf(KDisplayLogFile, &logfile);
iFs.MkDirAll(logfile);
iLogBuf=HBufC::NewL(KMaxLogLineLength);
iLogBuf8=HBufC8::NewL(KMaxLogLineLength);
return(iFile.Replace(iFs,logfile,EFileWrite|EFileShareAny));
}