26 #if ! defined (octave_url_transfer_h)
27 #define octave_url_transfer_h 1
29 #include "octave-config.h"
81 bool good (
void)
const {
return m_valid && m_ok; }
85 virtual std::string
lasterror (
void)
const {
return m_errmsg; }
89 return *m_curr_ostream;
94 return *m_curr_istream;
101 bool is_ascii (
void)
const {
return m_ascii_mode; }
105 virtual void cwd (
const std::string& ) { }
107 virtual void del (
const std::string& ) { }
109 virtual void rmdir (
const std::string& ) { }
111 virtual void mkdir (
const std::string& ) { }
113 virtual void rename (
const std::string& ,
114 const std::string& ) { }
116 virtual void put (
const std::string& ,
119 virtual void get (
const std::string& ,
123 const std::string& target);
126 const std::string& directory);
128 virtual void dir (
void) { }
137 virtual std::string
pwd (
void) {
return ""; }
144 const std::string& ) { }
175 url_transfer (
const std::string& host,
const std::string& user,
176 const std::string& passwd, std::ostream& os);
178 url_transfer (
const std::string& url, std::ostream& os);
194 return m_rep->set_ostream (os);
199 return m_rep->set_istream (is);
210 void cwd (
const std::string& path) {
m_rep->cwd (path); }
212 void del (
const std::string& file) {
m_rep->del (file); }
214 void rmdir (
const std::string& path) {
m_rep->rmdir (path); }
216 void mkdir (
const std::string& path) {
m_rep->mkdir (path); }
218 void rename (
const std::string& oldname,
const std::string& newname)
220 m_rep->rename (oldname, newname);
223 void put (
const std::string& file, std::istream& is)
225 m_rep->put (file, is);
228 void get (
const std::string& file, std::ostream& os)
230 m_rep->get (file, os);
234 const std::string& target)
236 m_rep->mget_directory (directory, target);
240 const std::string& directory)
242 return m_rep->mput_directory (base, directory);
250 OCTAVE_TIME_T& filetime,
bool& fileisdir)
252 m_rep->get_fileinfo (filename, filesize, filetime, fileisdir);
259 m_rep->http_get (param);
264 m_rep->http_post (param);
268 const std::string& action)
270 m_rep->http_action (param, action);
275 m_rep->cookie_jar (filename);
280 m_rep->set_header_fields (param);
285 m_rep->form_data_post (param);
290 m_rep->set_weboptions (param);
295 std::shared_ptr<base_url_transfer>
m_rep;
virtual void http_get(const Array< std::string > &)
virtual void rename(const std::string &, const std::string &)
std::string m_host_or_url
virtual void form_data_post(const Array< std::string > &)
virtual void get(const std::string &, std::ostream &)
virtual void binary(void)
virtual ~base_url_transfer(void)=default
virtual void set_weboptions(const struct weboptions &)
virtual void put(const std::string &, std::istream &)
virtual void set_header_fields(const Array< std::string > &)
bool is_valid(void) const
virtual void cwd(const std::string &)
virtual void cookie_jar(const std::string &)
virtual void perform(void)
virtual void del(const std::string &)
std::istream * m_curr_istream
virtual std::string pwd(void)
virtual std::istream & set_istream(std::istream &)
virtual void http_post(const Array< std::string > &)
virtual void get_fileinfo(const std::string &, double &, OCTAVE_TIME_T &, bool &)
virtual std::string lasterror(void) const
virtual string_vector list(void)
virtual std::ostream & set_ostream(std::ostream &)
bool is_binary(void) const
bool is_ascii(void) const
std::ostream * m_curr_ostream
virtual void http_action(const Array< std::string > &, const std::string &)
virtual void rmdir(const std::string &)
base_url_transfer(const base_url_transfer &)=delete
virtual void mkdir(const std::string &)
void put(const std::string &file, std::istream &is)
void get_fileinfo(const std::string &filename, double &filesize, OCTAVE_TIME_T &filetime, bool &fileisdir)
std::ostream & set_ostream(std::ostream &os)
void get(const std::string &file, std::ostream &os)
void http_post(const Array< std::string > ¶m)
void cwd(const std::string &path)
void set_header_fields(const Array< std::string > ¶m)
void set_weboptions(const struct weboptions ¶m)
bool is_valid(void) const
bool is_ascii(void) const
std::istream & set_istream(std::istream &is)
void http_get(const Array< std::string > ¶m)
void mkdir(const std::string &path)
string_vector mput_directory(const std::string &base, const std::string &directory)
void http_action(const Array< std::string > ¶m, const std::string &action)
std::string lasterror(void) const
url_transfer & operator=(const url_transfer &)=default
void mget_directory(const std::string &directory, const std::string &target)
url_transfer(const url_transfer &)=default
~url_transfer(void)=default
void cookie_jar(const std::string &filename)
bool is_binary(void) const
void rmdir(const std::string &path)
std::shared_ptr< base_url_transfer > m_rep
void del(const std::string &file)
void rename(const std::string &oldname, const std::string &newname)
void form_data_post(const Array< std::string > ¶m)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string ContentReader
std::string RequestMethod
Array< std::string > HeaderFields
std::string CertificateFilename