00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _WXCURLFTPTOOL_H__INCLUDED_
00012 #define _WXCURLFTPTOOL_H__INCLUDED_
00013
00014 #include <wx/curl/ftp.h>
00015
00016
00017
00019
00020 extern "C"
00021 {
00022 }
00023
00024
00025
00027
00028 class wxCurlFTPTool;
00029
00030 class WXDLLIMPEXP_CURL wxCurlFTPFs
00031 {
00032 friend class wxCurlFTPTool;
00033
00034 public:
00035 wxCurlFTPFs();
00036 wxCurlFTPFs(const wxString& szName ,
00037 const bool& bIsDir ,
00038 const bool& bIsFile ,
00039 const time_t& tLastModified ,
00040 const long& iContentLength );
00041 ~wxCurlFTPFs();
00042
00043 bool IsDirectory() const { return m_bIsDir; }
00044 bool IsFile() const { return m_bIsFile; }
00045
00046 wxString GetName() const { return m_szName; }
00047
00048 wxDateTime GetLastModified() const { return m_dtLastModified; }
00049
00050 long GetContentLength() const { return m_iContentLength; }
00051
00052 wxString GetFileSuffix() const { return m_szName.AfterLast('.'); }
00053
00054
00055 protected:
00056 wxString m_szName;
00057
00058 bool m_bIsDir;
00059 bool m_bIsFile;
00060
00061 wxDateTime m_dtLastModified;
00062
00063 long m_iContentLength;
00064 };
00065
00066 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxCurlFTPFs, wxArrayFTPFs, WXDLLIMPEXP_CURL);
00067
00068
00069
00071
00072 class WXDLLIMPEXP_CURL wxCurlFTPTool : public wxCurlFTP
00073 {
00074 public:
00075 wxCurlFTPTool(const wxString& szURL = wxEmptyString,
00076 const wxString& szUserName = wxEmptyString,
00077 const wxString& szPassword = wxEmptyString,
00078 wxEvtHandler* pEvtHandler = NULL, int id = wxID_ANY,
00079 long flags = wxCURL_DEFAULT_FLAGS);
00080 virtual ~wxCurlFTPTool();
00081
00082
00083
00084 bool GetFTPFs(wxArrayFTPFs& fs, const wxString& szRemoteLoc = wxEmptyString);
00085 bool Exists(const wxString& szRemoteLoc = wxEmptyString);
00086 bool IsDirectory(const wxString& szRemoteLoc = wxEmptyString);
00087 bool HasDirectory(const wxString& szRemoteLoc = wxEmptyString) { return IsDirectory(szRemoteLoc); }
00088 wxDateTime GetLastModified(const wxString& szRemoteLoc = wxEmptyString);
00089 long GetContentLength(const wxString& szRemoteLoc = wxEmptyString);
00090 wxString GetFileSuffix(const wxString& szRemoteLoc = wxEmptyString);
00091
00092 protected:
00093
00094 private:
00095
00096 };
00097
00098 #endif // _WXCURLFTPTOOL_H__INCLUDED_