X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e907fab47d506f5c8096b4a7675d9bd4216320e..13de0c8c9b6b3d2e8ce5a21388f5f104b2f68338:/include/wx/protocol/ftp.h?ds=sidebyside diff --git a/include/wx/protocol/ftp.h b/include/wx/protocol/ftp.h index b9194c7db1..697557fc6f 100644 --- a/include/wx/protocol/ftp.h +++ b/include/wx/protocol/ftp.h @@ -3,30 +3,34 @@ // Purpose: FTP protocol // Author: Vadim Zeitlin // Modified by: Mark Johnson, wxWindows@mj10777.de -// 20000917 : RmDir, GetLastResult, GetList +// 20000917 : RmDir, GetLastResult, GetList // Created: 07/07/1997 // RCS-ID: $Id$ // Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WX_FTP_H__ #define __WX_FTP_H__ -#ifdef __GNUG__ -#pragma interface +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) + #pragma interface "ftp.h" #endif -#include "wx/object.h" +#include "wx/defs.h" + +#if wxUSE_PROTOCOL_FTP + #include "wx/sckaddr.h" #include "wx/protocol/protocol.h" #include "wx/url.h" -class WXDLLEXPORT wxFTP : public wxProtocol +class WXDLLIMPEXP_NET wxFTP : public wxProtocol { public: enum TransferMode { + NONE, // not set by user explicitly ASCII, BINARY }; @@ -77,6 +81,16 @@ public: bool Rename(const wxString& src, const wxString& dst); bool RmFile(const wxString& path); + // Get the size of a file in the current dir. + // this function tries its best to deliver the size in bytes using BINARY + // (the SIZE command reports different sizes depending on whether + // type is set to ASCII or BINARY) + // returns -1 if file is non-existant or size could not be found + int GetFileSize(const wxString& fileName); + + // Check to see if a file exists in the current dir + bool FileExists(const wxString& fileName); + // Download methods bool Abort(); @@ -106,11 +120,6 @@ public: const wxString& wildcard = wxEmptyString, bool details = FALSE); -#ifdef WXWIN_COMPATIBILITY_2 - // deprecated - wxList *GetList(const wxString& wildcard, bool details = FALSE); -#endif // WXWIN_COMPATIBILITY_2 - protected: // this executes a simple ftp command with the given argument and returns // TRUE if it its return code starts with '2' @@ -135,14 +144,21 @@ protected: // true if there is an FTP transfer going on bool m_streaming; - // true if the user had set the transfer mode - bool m_modeSet; + // although this should be set to ASCII by default according to STD9, + // we will use BINARY transfer mode by default for backwards compatibility + TransferMode m_currentTransfermode; friend class wxInputFTPStream; friend class wxOutputFTPStream; - DECLARE_DYNAMIC_CLASS(wxFTP) + DECLARE_DYNAMIC_CLASS_NO_COPY(wxFTP) DECLARE_PROTOCOL(wxFTP) }; +// the trace mask used by assorted wxLogTrace() in ftp code, do +// wxLog::AddTraceMask(FTP_TRACE_MASK) to see them in output +#define FTP_TRACE_MASK _T("ftp") + +#endif // wxUSE_PROTOCOL_FTP + #endif // __WX_FTP_H__