ftp.h
Go to the documentation of this file.00001 #ifndef ftp_header_included
00002 #define ftp_header_included
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00033
00034 #include <cxxtls/file.h>
00035
00036 namespace cxxtls
00037 {
00038
00039 class FTP
00045 {
00046 public:
00047
00048 typedef std::string string;
00049
00050 enum constants
00051 {
00052 max_ftp_line_length=2048
00053 };
00054
00055
00056 static string error();
00058
00059
00060 static bool parse_ftp_dir_text(char const* buffer,
00061 FileStatus* statbuf,
00062 FileName* filename
00063 );
00076
00077
00078 struct FileInfo
00081 {
00082 FileName name_;
00083 FileStatus status_;
00084
00085 FileInfo(FileName const &name, FileStatus const& status)
00086 : name_(name),
00087 status_(status)
00088 {
00090 }
00091
00092 FileInfo()
00093 {
00094 }
00095
00096
00097 };
00098
00099
00100 static int stat_matching(char const *host,
00101 char const *user,
00102 char const *password,
00103 char const *pattern,
00104 std::list<FileInfo> *output);
00119
00120 static int stat_matching(string host,
00121 string user,
00122 string password,
00123 string pattern,
00124 std::list<FileInfo>* l)
00139 {
00140 return stat_matching(host.c_str(),
00141 user.c_str(),
00142 password.c_str(),
00143 pattern.c_str(),
00144 l
00145 );
00146 }
00147
00148
00149 static bool get(string host,
00150 string user,
00151 string password,
00152 FileName pathname,
00153 string to_file=""
00154 );
00165
00166 static bool put(string host,
00167 string user,
00168 string password,
00169 FileName pathname,
00170 string from_file=""
00171 );
00183
00184 static bool del(string host,
00185 string user,
00186 string password,
00187 FileName pathname
00188 );
00189
00196
00197 };
00198 }
00199 #endif