Static Public Member Functions | List of all members
vul_url Class Reference

Functions to test and open streams via a URL. More...

#include <vul_url.h>

Static Public Member Functions

static std::istream * open (const char *url, std::ios::openmode mode=std::ios::in)
 open a URL. More...
 
static bool exists (const char *url)
 Does that URL exist. More...
 
static bool is_url (const char *url)
 Is that a URL. More...
 
static bool is_file (const char *url)
 Is that a file. More...
 
static std::string encode_base64 (const std::string &in)
 Encode a string of chars into base64 format. More...
 
static std::string decode_base64 (const std::string &in)
 Decode a string of chars from base64 format. More...
 

Detailed Description

Functions to test and open streams via a URL.

Currently supports file and HTTP only. HTTP support includes basic authentication, using the normal HTTP URL scheme, e.g. http://user4:mypassword@webserverthingy.org/file.txt

Definition at line 25 of file vul_url.h.

Member Function Documentation

◆ decode_base64()

std::string vul_url::decode_base64 ( const std::string &  in)
static

Decode a string of chars from base64 format.

Definition at line 649 of file vul_url.cxx.

◆ encode_base64()

std::string vul_url::encode_base64 ( const std::string &  in)
static

Encode a string of chars into base64 format.

Definition at line 570 of file vul_url.cxx.

◆ exists()

bool vul_url::exists ( const char *  url)
static

Does that URL exist.

If the URL does not begin with a recognised scheme identifier, the function will treat the parameter as a local filename

Definition at line 465 of file vul_url.cxx.

◆ is_file()

bool vul_url::is_file ( const char *  url)
static

Is that a file.

i.e. is it a downloadable URL, or a file on disk that isn't a directory.

Definition at line 521 of file vul_url.cxx.

◆ is_url()

bool vul_url::is_url ( const char *  url)
static

Is that a URL.

as opposed to an ordinary filename.

Definition at line 493 of file vul_url.cxx.

◆ open()

std::istream * vul_url::open ( const char *  url,
std::ios::openmode  mode = std::ios::in 
)
static

open a URL.

If URL is "file://..." open as a file with given mode. If URL is "http://..." open using vul_http_open If URL is "ftp://..." attempt ftp Otherwise assume it is a filename and open with given mode

Definition at line 436 of file vul_url.cxx.


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