NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
url Namespace Reference

Classes

class  Error
 A class for URL exceptions. More...
 

Functions

static size_t writer (char *data, size_t size, size_t nmemb, std::string *writerData)
 libcurl write callback function. More...
 
static size_t reader (char *ptr, size_t size, size_t nmemb, void *stream)
 libcurl read callback function. More...
 
static CURL * common_init (const std::string &sUrl, const std::string &sUserName, const std::string &sPassWord)
 Perform common CURL initialization. More...
 
static CURL * get_init (const std::string &sUrl, const std::string &sUserName, const std::string &sPassWord, std::string *buffer)
 libcurl get connection initialization. More...
 
static CURL * put_init (const std::string &sUrl, const std::string &sUserName, const std::string &sPassWord, std::ifstream *filestream, size_t filesize)
 libcurl put connection initialization. More...
 
std::string get (const std::string &sUrl, const std::string &sUserName, const std::string &sPassWord)
 Get the contents of a URL. More...
 
size_t put (const std::string &sUrl, const std::string &sFileName, const std::string &sUserName, const std::string &sPassWord)
 Upload a file to a destination and return the transmitted bytes. More...
 

Variables

static char errorBuffer [CURL_ERROR_SIZE]
 libcurl variable for error strings. More...
 

Function Documentation

◆ common_init()

static CURL * url::common_init ( const std::string &  sUrl,
const std::string &  sUserName,
const std::string &  sPassWord 
)
static

Perform common CURL initialization.

Parameters
sUrlconst std::string&
sUserNameconst std::string&
sPassWordconst std::string&
Returns
CURL*

Definition at line 88 of file http.cpp.

References errorBuffer.

Referenced by get_init(), and put_init().

◆ get()

std::string url::get ( const std::string &  sUrl,
const std::string &  sUserName,
const std::string &  sPassWord 
)

Get the contents of a URL.

Parameters
sUrlconst std::string&
sUserNameconst std::string&
sPassWordconst std::string&
Returns
std::string
Exceptions
http::Error

Definition at line 251 of file http.cpp.

References errorBuffer, and get_init().

Referenced by Memory::convert(), Memory::convertColumns(), PackageRepoBrowser::getFileFromRepo(), PackageRepoBrowser::getRepoList(), PackageRepoBrowser::populatePackageList(), Memory::setCategories(), and urlExecute().

Here is the call graph for this function:

◆ get_init()

static CURL * url::get_init ( const std::string &  sUrl,
const std::string &  sUserName,
const std::string &  sPassWord,
std::string *  buffer 
)
static

libcurl get connection initialization.

Parameters
connCURL*&
sUrlconst std::string&
sUserNameconst std::string&
sPassWordconst std::string&
bufferstd::string*
Returns
CURL*
Exceptions
http::Error

Definition at line 168 of file http.cpp.

References common_init(), errorBuffer, and writer().

Referenced by get().

Here is the call graph for this function:

◆ put()

size_t url::put ( const std::string &  sUrl,
const std::string &  sFileName,
const std::string &  sUserName,
const std::string &  sPassWord 
)

Upload a file to a destination and return the transmitted bytes.

Parameters
sUrlconst std::string&
sFileNameconst std::string&
sUserNameconst std::string&
sPassWordconst std::string&
Returns
size_t

Definition at line 286 of file http.cpp.

References errorBuffer, and put_init().

Referenced by urlExecute().

Here is the call graph for this function:

◆ put_init()

static CURL * url::put_init ( const std::string &  sUrl,
const std::string &  sUserName,
const std::string &  sPassWord,
std::ifstream *  filestream,
size_t  filesize 
)
static

libcurl put connection initialization.

Parameters
sUrlconst std::string&
sUserNameconst std::string&
sPassWordconst std::string&
filestreamstd::ifstream*
filesizesize_t
Returns
CURL*
Exceptions
http::Error

Definition at line 207 of file http.cpp.

References common_init(), errorBuffer, and reader().

Referenced by put().

Here is the call graph for this function:

◆ reader()

static size_t url::reader ( char *  ptr,
size_t  size,
size_t  nmemb,
void *  stream 
)
static

libcurl read callback function.

Parameters
ptrchar*
sizesize_t
nmembsize_t
streamvoid*
Returns
size_t

Definition at line 71 of file http.cpp.

Referenced by put_init().

◆ writer()

static size_t url::writer ( char *  data,
size_t  size,
size_t  nmemb,
std::string *  writerData 
)
static

libcurl write callback function.

Parameters
datachar*
sizesize_t
nmembsize_t
writerDatastd::string*
Returns
size_t

Definition at line 50 of file http.cpp.

Referenced by get_init().

Variable Documentation

◆ errorBuffer

char url::errorBuffer[CURL_ERROR_SIZE]
static

libcurl variable for error strings.

Definition at line 37 of file http.cpp.

Referenced by common_init(), get(), get_init(), put(), and put_init().