1 #ifndef FILE_UPLOAD_CLIENT_H 2 #define FILE_UPLOAD_CLIENT_H 3 4 5 #include <stdio.h> 6 #include <string> 7 8 using std::string; 9 10 11 class FileUploadClient { 12 public: 13 FileUploadClient(); 14 virtual ~FileUploadClient(); 15 16 enum ftp_mode { 17 binary_mode, 18 ascii_mode 19 }; 20 21 virtual bool Connect(const string& server, const string& login, 22 const string& passwd); 23 24 virtual bool PutFile(const string& local, const string& remote, 25 ftp_mode mode = binary_mode); 26 27 virtual bool GetFile(const string& remote, const string& local, 28 ftp_mode mode = binary_mode); 29 30 virtual bool MoveFile(const string& oldPath, const string& newPath); 31 virtual bool ChangeDir(const string& dir); 32 virtual bool PrintWorkingDir(string& dir); 33 virtual bool ListDirContents(string& listing); 34 virtual bool Chmod(const string& path, const string& mod); 35 36 virtual void SetPassive(bool on); 37 }; 38 39 #endif // FILE_UPLOAD_CLIENT_H 40