48 uri(
const std::string & res) {
read(res); };
49 uri(
const uri & ref) =
default;
50 uri(
uri && ref)
noexcept =
default;
51 uri & operator = (
const uri & ref) =
default;
52 uri & operator = (
uri && ref)
noexcept =
default;
59 void read(
const std::string & res);
62 void clear() { path.
clear(); hostname = scheme = anchor =
""; };
68 const std::string &
get_scheme()
const {
return scheme; };
77 const std::string &
get_anchor()
const {
return anchor; };
89 void add(
const std::string & suppath) { path.
push_back(suppath); };
90 void add(
const chemin & suppath) { path += suppath; };
class chemin definition
Definition: chemin.hpp:51
void clear()
default copy constructor is OK
Definition: chemin.hpp:71
void push_back(const std::string &x)
add a member at the end of the path
Definition: chemin.cpp:72
uri type holds the splitted list of the scheme / hostname / path # anchor
Definition: uri.hpp:44
const std::string & get_anchor() const
retrieve the anchor previously assigned to this uri (empty string if none)
Definition: uri.hpp:77
void read(const std::string &res)
convert an uri from a string
Definition: uri.cpp:86
void trim_path()
clear the path part only
Definition: uri.hpp:65
const chemin & get_path() const
retrieve a path of the uri
Definition: uri.hpp:74
std::string get_string() const
rebuid the uri as a single string
Definition: uri.cpp:53
const std::string & get_hostname() const
obtain the URI host part
Definition: uri.hpp:71
const std::string & get_scheme() const
obtain the URI scheme (http, https, ftp, etc.)
Definition: uri.hpp:68
bool operator==(const uri &arg) const
the anchor part of the path is not used for comparison
Definition: uri.cpp:44
void add(const std::string &suppath)
add members to the uri
Definition: uri.hpp:89
std::string url_path_part() const
get relative url (path + anchor)
Definition: uri.cpp:71
void clear()
clear the uri (empty uri)
Definition: uri.hpp:62
void set_anchor_to(const std::string &val)
assign/replace an anchor to this uri (or remove it "" is provided)
Definition: uri.hpp:80
uri()
constructors
Definition: uri.hpp:47