X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/634ad7722b38db9eeb20a861c4d7e6d0b37f184e..67414f005db844a7f5688169bc937269ea342c9c:/interface/wx/protocol/ftp.h diff --git a/interface/wx/protocol/ftp.h b/interface/wx/protocol/ftp.h index 12bbca605f..b6a7992ffc 100644 --- a/interface/wx/protocol/ftp.h +++ b/interface/wx/protocol/ftp.h @@ -3,19 +3,9 @@ // Purpose: interface of wxFTP // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -/** - Transfer modes used by wxFTP. -*/ -enum TransferMode -{ - NONE, //!< not set by user explicitly. - ASCII, - BINARY -}; - /** @class wxFTP @@ -47,14 +37,20 @@ enum TransferMode } ftp.ChDir("/pub/2.8.9"); - wxInputStream *i = ftp.GetInputStream("wxWidgets-2.8.9.tar.bz2"); + 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 *in = ftp.GetInputStream(filename); if ( !in ) { wxLogError("Couldn't get the file"); } else { - size_t size = in->GetSize(); char *data = new char[size]; if ( !in->Read(data, size) ) { @@ -94,6 +90,16 @@ enum TransferMode class wxFTP : public wxProtocol { public: + /** + Transfer modes used by wxFTP. + */ + enum TransferMode + { + NONE, //!< not set by user explicitly. + ASCII, + BINARY + }; + /** Default constructor. */ @@ -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 */