1. patch from Søren Erland Vestø implementing wxFTP::GetFileSize()
with my fixes to the patch 2. significantly updated/cleaned FTP tests in the sample 3. don't log FTP passwords in wxLogTrace git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9159 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#define __WX_FTP_H__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#pragma interface "ftp.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h"
|
||||
@@ -27,6 +27,7 @@ class WXDLLEXPORT wxFTP : public wxProtocol
|
||||
public:
|
||||
enum TransferMode
|
||||
{
|
||||
NONE, // not set by user explicitly
|
||||
ASCII,
|
||||
BINARY
|
||||
};
|
||||
@@ -77,6 +78,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();
|
||||
|
||||
@@ -135,8 +146,9 @@ 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;
|
||||
@@ -145,4 +157,8 @@ protected:
|
||||
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 // __WX_FTP_H__
|
||||
|
Reference in New Issue
Block a user