X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/730b772b41ad9df76e5226290bb9eb917ea161f0..b8737371e220ef1920e6a3d2aed88c4bc2b04daf:/interface/wx/protocol/ftp.h diff --git a/interface/wx/protocol/ftp.h b/interface/wx/protocol/ftp.h index 7163db5124..aecb0ddb3b 100644 --- a/interface/wx/protocol/ftp.h +++ b/interface/wx/protocol/ftp.h @@ -3,7 +3,7 @@ // Purpose: interface of wxFTP // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -46,19 +46,25 @@ enum TransferMode return; } - ftp.ChDir("/pub/2.8.9); - wxInputStream *i = ftp.GetInputStream("wxWidgets-2.8.9.tar.bz2"); + ftp.ChDir("/pub/2.8.9"); + const char *filename = "wxWidgets-2.8.9.tar.bz2"; + int size = ftp.GetFileSize(filename); + if ( size == -1 ) + { + wxLogError("Couldn't get the file size for \"%s\"", filename); + } + + wxInputStream *i = ftp.GetInputStream(filename); if ( !in ) { - wxLogError("Coudln't get file"); + wxLogError("Couldn't get the file"); } else { - size_t size = in-GetSize(); char *data = new char[size]; if ( !in->Read(data, size) ) { - wxLogError("Read error"); + wxLogError("Read error: %d", ftp.GetError()); } else { @@ -106,6 +112,22 @@ public: + //@{ + /** + Connect to the FTP server to default port (21) of the specified @a host. + */ + virtual bool Connect(const wxString& host); + + /** + Connect to the FTP server to any port of the specified @a host. + By default (@a port = 0), connection is made to default FTP port (21) + of the specified @a host. + + @since 2.9.1 + */ + virtual bool Connect(const wxString& host, unsigned short port); + //@} + /** @name Functions for managing the FTP connection */