26 #if ! defined (octave_url_transfer_h)
27 #define octave_url_transfer_h 1
29 #include "octave-config.h"
77 bool good ()
const {
return m_valid && m_ok; }
81 virtual std::string
lasterror ()
const {
return m_errmsg; }
85 return *m_curr_ostream;
90 return *m_curr_istream;
97 bool is_ascii ()
const {
return m_ascii_mode; }
101 virtual void cwd (
const std::string& ) { }
103 virtual void del (
const std::string& ) { }
105 virtual void rmdir (
const std::string& ) { }
107 virtual void mkdir (
const std::string& ) { }
109 virtual void rename (
const std::string& ,
110 const std::string& ) { }
112 virtual void put (
const std::string& ,
115 virtual void get (
const std::string& ,
119 const std::string& target);
122 const std::string& directory);
133 virtual std::string
pwd () {
return ""; }
140 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);
182 bool is_valid ()
const {
return m_rep->is_valid (); }
184 bool good ()
const {
return m_rep->good (); }
186 std::string
lasterror ()
const {
return m_rep->lasterror (); }
190 return m_rep->set_ostream (os);
195 return m_rep->set_istream (is);
202 bool is_ascii ()
const {
return m_rep->is_ascii (); }
206 void cwd (
const std::string& path) { m_rep->cwd (path); }
208 void del (
const std::string& file) { m_rep->del (file); }
210 void rmdir (
const std::string& path) { m_rep->rmdir (path); }
212 void mkdir (
const std::string& path) { m_rep->mkdir (path); }
214 void rename (
const std::string& oldname,
const std::string& newname)
216 m_rep->rename (oldname, newname);
219 void put (
const std::string& file, std::istream& is)
221 m_rep->put (file, is);
224 void get (
const std::string& file, std::ostream& os)
226 m_rep->get (file, os);
230 const std::string& target)
232 m_rep->mget_directory (directory, target);
236 const std::string& directory)
238 return m_rep->mput_directory (base, directory);
241 void dir () { m_rep->dir (); }
246 OCTAVE_TIME_T& filetime,
bool& fileisdir)
248 m_rep->get_fileinfo (filename, filesize, filetime, fileisdir);
251 std::string
pwd () {
return m_rep->pwd (); }
255 m_rep->http_get (param);
260 m_rep->http_post (param);
264 const std::string& action)
266 m_rep->http_action (param, action);
271 m_rep->cookie_jar (filename);
276 m_rep->set_header_fields (param);
281 m_rep->form_data_post (param);
286 m_rep->set_weboptions (param);
291 std::shared_ptr<base_url_transfer> m_rep;
294 OCTAVE_END_NAMESPACE(
octave)
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 set_weboptions(const struct weboptions &)
virtual void put(const std::string &, std::istream &)
virtual void set_header_fields(const Array< std::string > &)
virtual void cwd(const std::string &)
virtual std::string pwd()
virtual void cookie_jar(const std::string &)
virtual void del(const std::string &)
std::istream * m_curr_istream
virtual string_vector list()
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::ostream & set_ostream(std::ostream &)
std::ostream * m_curr_ostream
virtual void http_action(const Array< std::string > &, const std::string &)
virtual void rmdir(const std::string &)
virtual void mkdir(const std::string &)
virtual std::string lasterror() const
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)
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)
std::string lasterror() const
void http_action(const Array< std::string > ¶m, const std::string &action)
url_transfer & operator=(const url_transfer &)=default
void mget_directory(const std::string &directory, const std::string &target)
url_transfer(const url_transfer &)=default
void cookie_jar(const std::string &filename)
void rmdir(const std::string &path)
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