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


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

本文整理汇总了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;
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:38,代码来源:ExampleServer.cpp

示例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();
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:29,代码来源:ExampleServer.cpp

示例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");
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:31,代码来源:PodcastModel.cpp

示例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));
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:33,代码来源:t_compare.cpp

示例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 );
	}
开发者ID:Yelinson,项目名称:OpenVideoHub,代码行数:55,代码来源:emTubePlaylistManager.cpp

示例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);
	}
开发者ID:flaithbheartaigh,项目名称:lemonplayer,代码行数:12,代码来源:TangramAnimation.cpp

示例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();
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:53,代码来源:aknfilesettingpage.cpp

示例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);
}
开发者ID:max3903,项目名称:SFLphone,代码行数:34,代码来源:symbian_ua_guiAppUi.cpp

示例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
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:35,代码来源:ExampleServer.cpp

示例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
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:33,代码来源:DebugLog.cpp

示例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;
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:33,代码来源:CONLIST.CPP

示例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);
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:29,代码来源:T_certstoreactionslistcertificates.cpp

示例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();
	}	
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:60,代码来源:archiveStep.cpp

示例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);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:30,代码来源:MsvTestUtilsBase.cpp

示例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));
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:28,代码来源:MsvTestUtilsBase.cpp


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