28 #if !defined (octave_url_transfer_h)
29 #define octave_url_transfer_h 1
44 curl_xfer->
cwd (
"..");
52 : count (1), host_or_url (), valid (false), ftp (false),
53 ascii_mode (false), ok (true), errmsg (),
54 curr_istream (&
std::cin), curr_ostream (&
std::cout)
61 : count (1), host_or_url (host), valid (false), ftp (true),
62 ascii_mode (false), ok (true), errmsg (), curr_istream (&
std::cin),
63 curr_ostream (&os) { }
66 : count (1), host_or_url (url), valid (false), ftp (false),
67 ascii_mode (false), ok (true), errmsg (),
68 curr_istream (&
std::cin), curr_ostream (&os) { }
74 bool good (
void)
const {
return valid && ok; }
78 virtual std::string
lasterror (
void)
const {
return errmsg; }
94 bool is_ascii (
void)
const {
return ascii_mode; }
98 virtual void cwd (
const std::string& ) { }
100 virtual void del (
const std::string& ) { }
102 virtual void rmdir (
const std::string& ) { }
104 virtual void mkdir (
const std::string& ) { }
106 virtual void rename (
const std::string& ,
107 const std::string& ) { }
109 virtual void put (
const std::string& ,
112 virtual void get (
const std::string& ,
116 const std::string& target);
119 const std::string& directory);
121 virtual void dir (
void) { }
130 virtual std::string
pwd (
void) {
return std::string (); }
137 const std::string& ) { }
171 url_transfer (
const std::string& host,
const std::string& user,
172 const std::string& passwd, std::ostream& os);
174 url_transfer (
const std::string& url, std::ostream& os);
233 void rename (
const std::string& oldname,
const std::string& newname)
238 void put (
const std::string& file, std::istream& is)
243 void get (
const std::string& file, std::ostream& os)
249 const std::string& target)
255 const std::string& directory)
265 time_t& filetime,
bool& fileisdir)
277 const std::string& action)
virtual std::ostream & set_ostream(std::ostream &)
virtual void binary(void)
virtual ~base_url_transfer(void)
bool is_ascii(void) const
virtual void get(const std::string &, std::ostream &)
virtual void http_get(const Array< std::string > &)
virtual void cwd(const std::string &)
virtual void perform(void)
void http_post(const Array< std::string > ¶m)
url_transfer(const url_transfer &h)
virtual void put(const std::string &, std::istream &)
virtual void rmdir(const std::string &)
virtual std::istream & set_istream(std::istream &)
base_url_transfer(const std::string &url, std::ostream &os)
url_transfer & operator=(const url_transfer &h)
bool is_binary(void) const
void put(const std::string &file, std::istream &is)
void del(const std::string &file)
virtual void del(const std::string &)
base_url_transfer(const std::string &host, const std::string &, const std::string &, std::ostream &os)
void rename(const std::string &oldname, const std::string &newname)
bool is_valid(void) const
virtual void mkdir(const std::string &)
void http_get(const Array< std::string > ¶m)
void mget_directory(const std::string &directory, const std::string &target)
octave_refcount< size_t > count
std::string lasterror(void) const
void cwd(const std::string &path)
virtual void get_fileinfo(const std::string &, double &, time_t &, bool &)
void get_fileinfo(const std::string &filename, double &filesize, time_t &filetime, bool &fileisdir)
void http_action(const Array< std::string > ¶m, const std::string &action)
virtual void rename(const std::string &, const std::string &)
string_vector mput_directory(const std::string &base, const std::string &directory)
void mkdir(const std::string &path)
std::ostream & set_ostream(std::ostream &os)
std::istream * curr_istream
static void delete_file(const std::string &file)
bool is_binary(void) const
virtual void http_post(const Array< std::string > &)
void mget_directory(const std::string &directory, const std::string &target)
virtual std::string pwd(void)
virtual std::string lasterror(void) const
static void reset_path(base_url_transfer *curl_xfer)
virtual void http_action(const Array< std::string > &, const std::string &)
void rmdir(const std::string &path)
string_vector mput_directory(const std::string &base, const std::string &directory)
bool is_ascii(void) const
std::istream & set_istream(std::istream &is)
virtual string_vector list(void)
bool is_valid(void) const
std::ostream * curr_ostream