GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
curl_transfer Class Reference
Inheritance diagram for curl_transfer:
Collaboration diagram for curl_transfer:

Public Member Functions

 curl_transfer (const curl_transfer &)=delete
 
 curl_transfer (const std::string &host, const std::string &user_arg, const std::string &passwd, std::ostream &os)
 
 curl_transfer (const std::string &url_str, std::ostream &os)
 
 curl_transfer (void)
 
 ~curl_transfer (void)
 
void ascii (void)
 
void binary (void)
 
void cookie_jar (const std::string &filename)
 
void cwd (const std::string &path)
 
void del (const std::string &file)
 
void dir (void)
 
void form_data_post (const Array< std::string > &param)
 
void get (const std::string &file, std::ostream &os)
 
void get_fileinfo (const std::string &filename, double &filesize, OCTAVE_TIME_T &filetime, bool &fileisdir)
 
bool good (void) const
 
void http_action (const Array< std::string > &param, const std::string &action)
 
void http_get (const Array< std::string > &param)
 
void http_post (const Array< std::string > &param)
 
bool is_ascii (void) const
 
bool is_binary (void) const
 
bool is_valid (void) const
 
std::string lasterror (void) const
 
string_vector list (void)
 
void mget_directory (const std::string &directory, const std::string &target)
 
void mkdir (const std::string &path)
 
string_vector mput_directory (const std::string &base, const std::string &directory)
 
curl_transferoperator= (const curl_transfer &)=delete
 
void perform (void)
 
void put (const std::string &file, std::istream &is)
 
std::string pwd (void)
 
void rename (const std::string &oldname, const std::string &newname)
 
void rmdir (const std::string &path)
 
void set_header_fields (const Array< std::string > &param)
 
std::istream & set_istream (std::istream &is)
 
std::ostream & set_ostream (std::ostream &os)
 
void set_weboptions (const struct weboptions &options)
 

Protected Attributes

bool m_ascii_mode
 
std::istream * m_curr_istream
 
std::ostream * m_curr_ostream
 
std::string m_errmsg
 
bool m_ftp
 
std::string m_host_or_url
 
bool m_ok
 
bool m_valid
 

Private Member Functions

std::string form_query_string (const Array< std::string > &param)
 
void ftp_file_or_dir_action (const std::string &file_or_dir, const std::string &action)
 
void init (const std::string &user, const std::string &passwd, std::istream &is, std::ostream &os)
 

Private Attributes

CURL * m_curl
 
CURLcode m_errnum
 
std::string m_url
 
std::string m_userpwd
 

Detailed Description

Definition at line 288 of file url-transfer.cc.

Constructor & Destructor Documentation

◆ curl_transfer() [1/4]

curl_transfer::curl_transfer ( void  )
inline

Definition at line 292 of file url-transfer.cc.

References m_curl, base_url_transfer::m_errmsg, and base_url_transfer::m_valid.

◆ curl_transfer() [2/4]

curl_transfer::curl_transfer ( const std::string &  host,
const std::string &  user_arg,
const std::string &  passwd,
std::ostream &  os 
)
inline

◆ curl_transfer() [3/4]

curl_transfer::curl_transfer ( const std::string &  url_str,
std::ostream &  os 
)
inline

◆ curl_transfer() [4/4]

curl_transfer::curl_transfer ( const curl_transfer )
delete

◆ ~curl_transfer()

curl_transfer::~curl_transfer ( void  )
inline

Definition at line 361 of file url-transfer.cc.

References m_curl.

Member Function Documentation

◆ ascii()

void curl_transfer::ascii ( void  )
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 399 of file url-transfer.cc.

References base_url_transfer::m_ascii_mode, and SETOPT.

◆ binary()

void curl_transfer::binary ( void  )
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 405 of file url-transfer.cc.

References base_url_transfer::m_ascii_mode, and SETOPT.

◆ cookie_jar()

void curl_transfer::cookie_jar ( const std::string &  filename)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 680 of file url-transfer.cc.

References SETOPT.

◆ cwd()

void curl_transfer::cwd ( const std::string &  path)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 411 of file url-transfer.cc.

References ftp_file_or_dir_action().

Referenced by get_fileinfo().

◆ del()

void curl_transfer::del ( const std::string &  file)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 416 of file url-transfer.cc.

References ftp_file_or_dir_action().

◆ dir()

void curl_transfer::dir ( void  )
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 486 of file url-transfer.cc.

References base_url_transfer::good(), base_url_transfer::m_host_or_url, m_url, perform(), and SETOPT.

◆ form_data_post()

void curl_transfer::form_data_post ( const Array< std::string > &  param)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 713 of file url-transfer.cc.

References base_url_transfer::m_host_or_url, Array< T, Alloc >::numel(), perform(), and SETOPT.

◆ form_query_string()

std::string curl_transfer::form_query_string ( const Array< std::string > &  param)
inlineprivate

Definition at line 859 of file url-transfer.cc.

References m_curl, and Array< T, Alloc >::numel().

Referenced by http_action().

◆ ftp_file_or_dir_action()

void curl_transfer::ftp_file_or_dir_action ( const std::string &  file_or_dir,
const std::string &  action 
)
inlineprivate

Definition at line 889 of file url-transfer.cc.

References base_url_transfer::good(), perform(), and SETOPT.

Referenced by cwd(), del(), mkdir(), and rmdir().

◆ get()

void curl_transfer::get ( const std::string &  file,
std::ostream &  os 
)
inlinevirtual

◆ get_fileinfo()

void curl_transfer::get_fileinfo ( const std::string &  filename,
double &  filesize,
OCTAVE_TIME_T &  filetime,
bool &  fileisdir 
)
inlinevirtual

◆ good()

bool base_url_transfer::good ( void  ) const
inlineinherited

◆ http_action()

void curl_transfer::http_action ( const Array< std::string > &  param,
const std::string &  action 
)
inlinevirtual

◆ http_get()

void curl_transfer::http_get ( const Array< std::string > &  param)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 629 of file url-transfer.cc.

References http_action().

◆ http_post()

void curl_transfer::http_post ( const Array< std::string > &  param)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 634 of file url-transfer.cc.

References http_action().

◆ init()

void curl_transfer::init ( const std::string &  user,
const std::string &  passwd,
std::istream &  is,
std::ostream &  os 
)
inlineprivate

Definition at line 807 of file url-transfer.cc.

References m_userpwd, OCTAVE_VERSION, read_data(), SETOPT, and write_data().

Referenced by curl_transfer().

◆ is_ascii()

bool base_url_transfer::is_ascii ( void  ) const
inlineinherited

Definition at line 101 of file url-transfer.h.

◆ is_binary()

bool base_url_transfer::is_binary ( void  ) const
inlineinherited

Definition at line 103 of file url-transfer.h.

◆ is_valid()

bool base_url_transfer::is_valid ( void  ) const
inlineinherited

Definition at line 79 of file url-transfer.h.

◆ lasterror()

std::string curl_transfer::lasterror ( void  ) const
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 378 of file url-transfer.cc.

References m_errnum.

◆ list()

string_vector curl_transfer::list ( void  )
inlinevirtual

◆ mget_directory()

◆ mkdir()

void curl_transfer::mkdir ( const std::string &  path)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 426 of file url-transfer.cc.

References ftp_file_or_dir_action().

◆ mput_directory()

string_vector base_url_transfer::mput_directory ( const std::string &  base,
const std::string &  directory 
)
inherited

◆ operator=()

curl_transfer& curl_transfer::operator= ( const curl_transfer )
delete

◆ perform()

void curl_transfer::perform ( void  )
inlinevirtual

◆ put()

void curl_transfer::put ( const std::string &  file,
std::istream &  is 
)
inlinevirtual

◆ pwd()

std::string curl_transfer::pwd ( void  )
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 596 of file url-transfer.cc.

References base_url_transfer::good(), perform(), SETOPTR, and write_data().

Referenced by get_fileinfo().

◆ rename()

void curl_transfer::rename ( const std::string &  oldname,
const std::string &  newname 
)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 431 of file url-transfer.cc.

References base_url_transfer::good(), perform(), and SETOPT.

◆ rmdir()

void curl_transfer::rmdir ( const std::string &  path)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 421 of file url-transfer.cc.

References ftp_file_or_dir_action().

◆ set_header_fields()

void curl_transfer::set_header_fields ( const Array< std::string > &  param)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 689 of file url-transfer.cc.

References Array< T, Alloc >::numel(), and SETOPT.

Referenced by set_weboptions().

◆ set_istream()

std::istream& curl_transfer::set_istream ( std::istream &  is)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 391 of file url-transfer.cc.

References base_url_transfer::m_curr_istream, and SETOPTR.

Referenced by put().

◆ set_ostream()

std::ostream& curl_transfer::set_ostream ( std::ostream &  os)
inlinevirtual

Reimplemented from base_url_transfer.

Definition at line 383 of file url-transfer.cc.

References base_url_transfer::m_curr_ostream, and SETOPTR.

Referenced by get().

◆ set_weboptions()

Member Data Documentation

◆ m_ascii_mode

bool base_url_transfer::m_ascii_mode
protectedinherited

Definition at line 160 of file url-transfer.h.

Referenced by ascii(), and binary().

◆ m_curl

CURL* curl_transfer::m_curl
private

◆ m_curr_istream

std::istream* base_url_transfer::m_curr_istream
protectedinherited

Definition at line 163 of file url-transfer.h.

Referenced by set_istream().

◆ m_curr_ostream

std::ostream* base_url_transfer::m_curr_ostream
protectedinherited

Definition at line 164 of file url-transfer.h.

Referenced by list(), and set_ostream().

◆ m_errmsg

std::string base_url_transfer::m_errmsg
protectedinherited

◆ m_errnum

CURLcode curl_transfer::m_errnum
private

Definition at line 789 of file url-transfer.cc.

Referenced by lasterror(), and perform().

◆ m_ftp

bool base_url_transfer::m_ftp
protectedinherited

Definition at line 159 of file url-transfer.h.

◆ m_host_or_url

std::string base_url_transfer::m_host_or_url
protectedinherited

Definition at line 157 of file url-transfer.h.

Referenced by dir(), form_data_post(), get(), get_fileinfo(), http_action(), list(), and put().

◆ m_ok

bool base_url_transfer::m_ok
protectedinherited

◆ m_url

std::string curl_transfer::m_url
private

Definition at line 804 of file url-transfer.cc.

Referenced by curl_transfer(), dir(), get(), get_fileinfo(), http_action(), list(), and put().

◆ m_userpwd

std::string curl_transfer::m_userpwd
private

Definition at line 805 of file url-transfer.cc.

Referenced by init().

◆ m_valid

bool base_url_transfer::m_valid
protectedinherited

Definition at line 158 of file url-transfer.h.

Referenced by curl_transfer().


The documentation for this class was generated from the following file: