⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ftpexampleengine.h

📁 Symbian智能手机操作系统源代码值的参考_网络ftp
💻 H
字号:
/*
* ============================================================================
*  Name     : CFtpExampleEngine from FtpExampleEngine.cpp
*  Part of  : FtpExample
*  Created  : 03/11/2005 by Forum Nokia
*  Version  : 1.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

#ifndef __FTPEXAMPLEENGINE_H
#define __FTPEXAMPLEENGINE_H

// INCLUDE FILES
#include <e32base.h> // CBase
#include <FTPSESS.h> // CFTPSession

// CLASS DECLARATION

/**
* Engine class.
* Handles FTP connection.
* 
*/
class CFtpExampleEngine : public CBase
	{
public: // Constructors and destructor

	/**
	* Two-phased constructor.
	*/
	static CFtpExampleEngine* NewL(MFtpSessionNotifier* aNotifier);
	
	/**
	* Destructor
	*/
	virtual ~CFtpExampleEngine();
	
public: // New functions

	/**
	* Connects to a remote FTP server, specifying the FTP server by a DNS name.
	* @param aHostName FTP server's DNS name.
	* @param aUserName User name to log on the FTP server.
	* @param aPassword Password to identify to the FTP server.
	* @param aConnectionMode Must use passive mode if the client is behind a firewall.
	*/
	void ConnectL(	const TDesC& aHostName,
					const TDesC& aUserName,
					const TDesC& aPassword,
					const CFTPSession::TConnectionMode& aConnectionMode);
					
	/**
	* Closes the current connection with the FTP server.
	*/
	void Disconnect();
	
	/**
	* Lists the files in a directory on the remote file system.
	* @param aDirectoryName A directory name. This can be absolute or relative.
	* @param aFileList On completion, the file list. The buffer is allocated by the client.
	*/
	void ListDirectoryL(const TDesC& aDirectoryName, TDes8& aFileList);
	
	/**
	* Gets the client's current directory on the remote file system.
	*/
	void CurrentDirectory();
	
	/**
	* Sets the current directory on the remote file system.
	* @param aDirectoryName Directory name.
	*/
	void ChangeDirectoryL(const TDesC& aDirectoryName);
	
	/**
	* Creates a directory on the remote file system.
	* @param aDirectoryName A directory name. This can be absolute or relative.
	*/
	void CreateDirectoryL(const TDesC& aDirectoryName);
	
	/**
	* Deletes a directory on the remote file system.
	* @param aDirectoryName A directory name. This can be absolute or relative.
	*/
	void DeleteDirectoryL(const TDesC& aDirectoryName);
	
	/**
	* Renames a file on the remote file system.
	* @param aRemoteFileName An existing file name.
	* @param aNewRemoteFileName A new file name.
	*/
	void RenameFileL(const TDesC& aRemoteFileName, const TDesC& aNewRemoteFileName);
	
	/**
	* Deletes a file on the remote file system.
	* @param aFileName A file name.
	*/
	void DeleteFileL(const TDesC& aFileName);
	
	/**
	* Transfers a file from the FTP server.
	* @param aRemoteFileName The remote file Name.
	* @param aLocalFileName Name of the local file to be created.
	* @param aBinary If true, the representation type of the transferred file is binary, otherwise ascii.
	*/
	void RetrieveL(	const TDesC& aRemoteFileName,
					const TDesC& aLocalFileName,
					const TBool& aBinary);
					
	/**
	* Transfers a file to the FTP server.
	* @param aLocalFileName Name of the local file to be sent.
	* @param aRemoteFileName The remote file Name.
	* @param aBinary If true, the representation type of the transferred file is binary, otherwise ascii.
	*/
	void StoreL(const TDesC& aLocalFileName,
				const TDesC& aRemoteFileName,
				const TBool& aBinary);

	/**
	* Cancels the last operation.
	*/
	void Cancel();
	
private:

	/**
	* Symbian OS default constructor
	*/
	void ConstructL(MFtpSessionNotifier* aNotifier);
	
private: // Data members

	CFTPSession* iFtpSession;
	};

#endif

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -