Symbian
 Developer Library

DEVELOPER LIBRARY

[Index] [Glossary] [Previous] [Next]



Location: FTPPROT.h
Link against: ftpprot.lib

Class CFtpProtocol

class CFtpProtocol : public CBase

Support

Supported from 6.0

Description

Implements an FTP engine, and allows the client to access the individual FTP commands as defined per the RFC959.

Note that before commands that cause data to transit on the DTP channel, (NLST, LIST, RETR, STOR), a data buffer must be provided using SendBuffer()/RecvBuffer(). Also, when the client is notified of a MoreData() event, it must reissue RecvBuffer() to get the rest of the data.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CFtpProtocolImplements an FTP engine, and allows the client to access the individual FTP commands as defined per the RFC959

Defined in CFtpProtocol:
Abor(), Acct(), Allo(), Allo(), Appe(), Cdup(), Connect(), Connect(), Connect(), Cwd(), Dele(), FTPServerAnswer(), GetVersion(), Help(), Help(), List(), List(), Mkd(), Mode(), NewL(), Nlst(), Nlst(), Noop(), Pass(), Pasv(), Port(), Port(), Pwd(), Quit(), RecvBuffer(), Rein(), Rest(), Retr(), Rmd(), Rnfr(), Rnto(), SendBuffer(), SendEOF(), Site(), Smnt(), Stat(), Stat(), Stor(), Stou(), Stru(), Syst(), Type(), Type(), User(), UserCancel(), ~CFtpProtocol()

Inherited from CBase:
operator new()


Construction and destruction


NewL()

static CFtpProtocol* NewL(MFtpProtocolNotifier* aNotifier);

Description

Allocates and constructs a new FTP engine object.

Parameters

MFtpProtocolNotifier* aNotifier

Client callback interface. The FTP engine calls this interface to pass server responses and status messages to the client.

Return value

CFtpProtocol*

New FTP engine object


~CFtpProtocol()

~CFtpProtocol();

Description

Destructor.

[Top]


Member functions


Connect()

virtual void Connect(TSockAddr& aNetAddr)=0;

Description

Connect to an FTP server, specifying an IP address.

Parameters

TSockAddr& aNetAddr

FTP server's IP address


Connect()

virtual void Connect(const THostName& aServerName)=0;

Description

Connect to an FTP server, specifying a DNS name.

Parameters

const THostName& aServerName

FTP server's DNS name


Connect()

virtual void Connect(const THostName& aServerName, const TUint aPort)=0;

Description

Connect to an FTP server, specifying a DNS name and port number.

Parameters

const THostName& aServerName

FTP server's DNS name

const TUint aPort

FTP server's port


User()

virtual void User(const TDesC8& aParam)=0;

Description

Issues the USER command.

Parameters

const TDesC8& aParam

Telnet string identifying the user


Pass()

virtual void Pass(const TDesC8& aParam)=0;

Description

Issues the PASS command.

Parameters

const TDesC8& aParam

Telnet string specifying the user's password


Acct()

virtual void Acct(const TDesC8& aParam)=0;

Description

Issues the ACCT command.

Parameters

const TDesC8& aParam

Telnet string identifying the user's account


Cwd()

virtual void Cwd(const TDesC8& aParam)=0;

Description

Issues the CWD command.

Parameters

const TDesC8& aParam

Directory or other system dependent file group designator


Cdup()

virtual void Cdup(void)=0;

Description

Issues the CDUP command.


Smnt()

virtual void Smnt(const TDesC8& aParam)=0;

Description

Issues the SMNT command.

Parameters

const TDesC8& aParam

Pathname specifying a directory or other system dependent file group designator


Quit()

virtual void Quit(void)=0;

Description

Issues the QUIT command.


Rein()

virtual void Rein(void)=0;

Description

Issues the REIN command.


Port()

virtual void Port(void)=0;

Description

Issues the PORT command, setting the Data Transfer Process port to a value allocated by the Sockets Server.


Port()

virtual void Port(TUint aPort)=0;

Description

Issues the PORT command, specifying a port number.

Parameters

TUint aPort

Port number


Pasv()

virtual void Pasv(void)=0;

Description

Issues the PASV command.


Type()

virtual void Type(const TDesC8& aParam)=0;

Description

Issues the TYPE command (single parameter).

Parameters

const TDesC8& aParam

First representation type parameter


Type()

virtual void Type(const TDesC8& aParam1, const TDesC8& aParam2)=0;

Description

Issues the TYPE command (two parameters).

Parameters

const TDesC8& aParam1

First representation type parameter

const TDesC8& aParam2

Second representation type parameter


Stru()

virtual void Stru(const TDesC8& aParam)=0;

Description

Issues the STRU command.

Parameters

const TDesC8& aParam

Telnet character code specifying the file structure


Mode()

virtual void Mode(const TDesC8& aParam)=0;

Description

Issues the MODE command.

Parameters

const TDesC8& aParam

Telnet character code specifying the data transfer mode


Retr()

virtual void Retr(const TDesC8& aFileName)=0;

Description

Issues the RETR command.

Parameters

const TDesC8& aFileName

File name


Stor()

virtual void Stor(const TDesC8& aFileName)=0;

Description

Issues the STOR command.

Parameters

const TDesC8& aFileName

File name


Stou()

virtual void Stou(void)=0;

Description

Issues the STOU command.


Appe()

virtual void Appe(const TDesC8& aFileName)=0;

Description

Issues the APPE command.

Parameters

const TDesC8& aFileName

File name


Allo()

virtual void Allo(const TDesC8& aParam)=0;

Description

Issues the ALLO command (single parameter).

Parameters

const TDesC8& aParam

Number of bytes (using the logical byte size) of storage to be reserved for the file


Allo()

virtual void Allo(const TDesC8& aParam1, const TDesC8& aParam2)=0;

Description

Issues the ALLO command (two parameters).

Parameters

const TDesC8& aParam1

Number of bytes (using the logical byte size) of storage to be reserved for the file

const TDesC8& aParam2

Maximum record or page size (in logical bytes)


Rest()

virtual void Rest(const TDesC8& aParam)=0;

Description

Issues the REST command.

Parameters

const TDesC8& aParam

The server marker at which file transfer is to be restarted


Rnfr()

virtual void Rnfr(const TDesC8& aFileName)=0;

Description

Issues the RNFR command.

Parameters

const TDesC8& aFileName

File name


Rnto()

virtual void Rnto(const TDesC8& aFileName)=0;

Description

Issues the RNTO command.

Parameters

const TDesC8& aFileName

File name


Abor()

virtual void Abor(void)=0;

Description

Issues the ABOR command.


Dele()

virtual void Dele(const TDesC8& aFileName)=0;

Description

Issues the DELE command.

Parameters

const TDesC8& aFileName

File name


Rmd()

virtual void Rmd(const TDesC8& aParam)=0;

Description

Issues the RMD command.

Parameters

const TDesC8& aParam

Directory name


Mkd()

virtual void Mkd(const TDesC8& aParam)=0;

Description

Issues the MKD command.

Parameters

const TDesC8& aParam

Directory name


Pwd()

virtual void Pwd(void)=0;

Description

Issues the PWD command.


List()

virtual void List(void)=0;

Description

Issues the LIST command, giving a null argument.


List()

virtual void List(const TDesC8& aParam)=0;

Description

Issues the LIST command, specifying a file/directory name.

Parameters

const TDesC8& aParam

File/directory name


Nlst()

virtual void Nlst(void)=0;

Description

Issues the NLST command, giving a null argument.


Nlst()

virtual void Nlst(const TDesC8& aParam)=0;

Description

Issues the NLST command, specifying a directory name.

Parameters

const TDesC8& aParam

Directory name


Site()

virtual void Site(const TDesC8& aParam)=0;

Description

Issues the SITE command.

Parameters

const TDesC8& aParam

SITE command argument


Syst()

virtual void Syst(void)=0;

Description

Issues the SYST command.


Stat()

virtual void Stat(const TDesC8& aParam)=0;

Description

Issues the STAT command, specifying an argument.

Parameters

const TDesC8& aParam

STAT command argument


Stat()

virtual void Stat(void)=0;

Description

Issues the STAT command (no argument).


Help()

virtual void Help(const TDesC8& aParam)=0;

Description

Issues the HELP command.

Parameters

const TDesC8& aParam

HELP command argument


Help()

virtual void Help(void)=0;

Description

Issues the HELP command (no argument).


Noop()

virtual void Noop(void)=0;

Description

Issues the NOOP command.


SendBuffer()

virtual void SendBuffer(TDes8* aBuffer)=0;

Description

Specifies a buffer to transfer data to the DTP channel.

Parameters

TDes8* aBuffer

Send receive


RecvBuffer()

virtual void RecvBuffer(TDes8* aBuffer)=0;

Description

Specifies a buffer to receive data from the DTP channel.

Parameters

TDes8* aBuffer

Receive buffer


SendEOF()

virtual void SendEOF(void)=0;

Description

Finishes the transfer initiated by a STOR command.


UserCancel()

virtual void UserCancel(void)=0;

Description

Cancels current operation.


FTPServerAnswer()

virtual void FTPServerAnswer(TDes& aServerAnswer)=0;

Description

Gets the 3 digits answer received from the FTP server.

Parameters

TDes& aServerAnswer

3 digit answer


GetVersion()

static TUint32 GetVersion(void);

Description

Gets API version number.

Return value

TUint32

32-bit number, with major version number in the highest byte and minor version number in the next byte