Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

PFTPClient Class Reference

#include <ftp.h>

Inheritance diagram for PFTPClient:

PFTP PInternetProtocol PIndirectChannel PChannel PObject List of all members.

Public Methods

 PFTPClient ()
 Declare an FTP client socket.

 ~PFTPClient ()
 Delete and close the socket.

Overrides from class PSocket.
virtual BOOL Close ()
New functions for class
BOOL LogIn (const PString &username, const PString &password)
PString GetSystemType ()
BOOL SetType (RepresentationType type)
BOOL ChangeDirectory (const PString &dirPath)
PString GetCurrentDirectory ()
PStringArray GetDirectoryNames (NameTypes type=ShortNames, DataChannelType channel=Passive)
PStringArray GetDirectoryNames (const PString &path, NameTypes type=ShortNames, DataChannelType channel=Passive)
PString GetFileStatus (const PString &path, DataChannelType channel=Passive)
PTCPSocketGetFile (const PString &filename, DataChannelType channel=NormalPort)
PTCPSocketPutFile (const PString &filename, DataChannelType channel=NormalPort)

Protected Methods

virtual BOOL OnOpen ()
 Call back to verify open succeeded in an PInternetProtocol class.

PTCPSocketNormalClientTransfer (Commands cmd, const PString &args)
PTCPSocketPassiveClientTransfer (Commands cmd, const PString &args)

Protected Attributes

WORD remotePort
 Port number on remote system.


Detailed Description

File Transfer Protocol client channel class.


Constructor & Destructor Documentation

PFTPClient::PFTPClient  
 

Declare an FTP client socket.

PFTPClient::~PFTPClient  
 

Delete and close the socket.


Member Function Documentation

BOOL PFTPClient::ChangeDirectory const PString   dirPath
 

Change the current directory on the remote FTP host.

Returns:
TRUE if the log in was successfull.
Parameters:
dirPath  New directory

virtual BOOL PFTPClient::Close   [virtual]
 

Close the socket, and if connected as a client, QUITs from server.

Returns:
TRUE if the channel was closed and the QUIT accepted by the server.

Reimplemented from PIndirectChannel.

PString PFTPClient::GetCurrentDirectory  
 

Get the current working directory on the remote FTP host.

Returns:
String for the directory path, or empty string if an error occurred.

PStringArray PFTPClient::GetDirectoryNames const PString   path,
NameTypes    type = ShortNames,
DataChannelType    channel = Passive
 

Get a list of files from the current working directory on the remote FTP host.

Returns:
String array for the files in the directory.
Parameters:
type  Name to get details for.
channel  Detail level on a directory entry. Data channel type.

PStringArray PFTPClient::GetDirectoryNames NameTypes    type = ShortNames,
DataChannelType    channel = Passive
 

Get a list of files from the current working directory on the remote FTP host.

Returns:
String array for the files in the directory.
Parameters:
channel  Detail level on a directory entry. Data channel type.

PTCPSocket* PFTPClient::GetFile const PString   filename,
DataChannelType    channel = NormalPort
 

Begin retreiving a file from the remote FTP server. The second parameter indicates that the transfer is on a normal or passive data channel. In short, a normal transfer the server connects to the client and in passive mode the client connects to the server.

Returns:
Socket to read data from, or NULL if an error occurred.
Parameters:
channel  Name of file to get Data channel type.

PString PFTPClient::GetFileStatus const PString   path,
DataChannelType    channel = Passive
 

Get status information for the file path specified.

Returns:
String giving file status.
Parameters:
channel  Path to get status for. Data channel type.

PString PFTPClient::GetSystemType  
 

Get the type of the remote FTP server system, eg Unix, WindowsNT etc.

Returns:
String for the type of system.

BOOL PFTPClient::LogIn const PString   username,
const PString   password
 

Log in to the remote host for FTP.

Returns:
TRUE if the log in was successfull.
Parameters:
password  User name for FTP log in. Password for the specified user name.

PTCPSocket* PFTPClient::NormalClientTransfer Commands    cmd,
const PString   args
[protected]
 

virtual BOOL PFTPClient::OnOpen   [protected, virtual]
 

Call back to verify open succeeded in an PInternetProtocol class.

Reimplemented from PIndirectChannel.

PTCPSocket* PFTPClient::PassiveClientTransfer Commands    cmd,
const PString   args
[protected]
 

PTCPSocket* PFTPClient::PutFile const PString   filename,
DataChannelType    channel = NormalPort
 

Begin storing a file to the remote FTP server. The second parameter indicates that the transfer is on a normal or passive data channel. In short, a normal transfer the server connects to the client and in passive mode the client connects to the server.

Returns:
Socket to write data to, or NULL if an error occurred.
Parameters:
channel  Name of file to get Data channel type.

BOOL PFTPClient::SetType RepresentationType    type
 

Set the transfer type.

Returns:
TRUE if transfer type set.
Parameters:
type  RepresentationTypeof file to transfer


Member Data Documentation

WORD PFTPClient::remotePort [protected]
 

Port number on remote system.


The documentation for this class was generated from the following file:
Generated on Fri Aug 13 15:50:06 2004 for PWLib by doxygen1.2.18