Classes | |
class | UrlBaseData |
Internal data used by UrlBase. More... | |
struct | ViewOption |
Url::asString() view options. More... | |
class | UrlBase |
Generic Url base class. More... | |
class | UrlException |
Base class for all URL exceptions. More... | |
class | UrlDecodingException |
Thrown if the encoded string contains a NUL byte (00). More... | |
class | UrlParsingException |
Thrown if the url or a component can't be parsed at all. More... | |
class | UrlBadComponentException |
Thrown if a url component is invalid. More... | |
class | UrlNotAllowedException |
Thrown if scheme does not allow a component. More... | |
class | UrlNotSupportedException |
Thrown if a feature e.g. More... | |
Typedefs | |
typedef std::map< std::string, std::string > | UrlConfig |
typedef ViewOption | ViewOptions |
ViewOptions is just an alias for ViewOption. | |
typedef std::vector< std::string > | UrlSchemes |
Vector of URL scheme names. | |
typedef RWCOW_pointer< UrlBase > | UrlRef |
Copy-On-Write Url reference. | |
typedef std::vector< std::string > | ParamVec |
A parameter vector container. | |
typedef std::map< std::string, std::string > | ParamMap |
A parameter map container. | |
Enumerations | |
enum | EEncoding { E_ENCODED, E_DECODED } |
Encoding flags. More... | |
Functions | |
void | checkUrlData (const std::string &data, const std::string &name, const std::string ®x, bool show=true) |
std::string | encode (const std::string &str, const std::string &safe="", EEncoding eflag=E_DECODED) |
Encodes a string using URL percent encoding. | |
std::string | decode (const std::string &str, bool allowNUL=false) |
Decodes a URL percent encoded string. | |
std::string | encode_octet (const unsigned char c) |
Encode one character. | |
int | decode_octet (const char *hex) |
Decode one character. | |
void | split (ParamVec &pvec, const std::string &pstr, const std::string &psep) |
Split into a parameter vector. | |
void | split (ParamMap &pmap, const std::string &pstr, const std::string &psep, const std::string &vsep, EEncoding eflag=E_ENCODED) |
Split into a parameter map. | |
std::string | join (const ParamVec &pvec, const std::string &psep) |
Join parameter vector to a string. | |
std::string | join (const ParamMap &pmap, const std::string &psep, const std::string &vsep, const std::string &safe) |
Join parameter map to a string. |
|
Definition at line 90 of file UrlBase.cc. |
|
ViewOptions is just an alias for ViewOption.
|
|
Vector of URL scheme names.
|
|
Copy-On-Write Url reference.
|
|
A parameter vector container. A string vector containing splited PathParam- or Query-String. Each string in the vector is allways URL percent encoded and usually contains a "key=value" pair. Definition at line 38 of file UrlUtils.h. |
|
A parameter map container. A map containing key and value pairs parsed from a PathParam- or Query-String. Definition at line 45 of file UrlUtils.h. |
|
Encoding flags.
Definition at line 50 of file UrlUtils.h. |
|
Definition at line 131 of file UrlBase.cc. References ZYPP_THROW. |
|
Encodes a string using URL percent encoding.
By default, all characters except of "a-zA-Z0-9_.-" will be encoded. Additional characters from the set ":/?#[]@!$&'()*+,;=", that are safe for a URL compoent without encoding, can be specified in the
If the
The following function call will encode the "@" character as "%40", but skip encoding of the "%" character, because the zypp::url::encode("foo%bar@localhost", "", E_ENCODED); eflag set to E_DECODED, the "%" character would be encoded as well. The complete encoded string would be "foo%25bar%40localhost".
Definition at line 30 of file UrlUtils.cc. Referenced by zypp::capability::CapabilityImpl::asString(), and zypp::capability::CapabilityImpl::index(). |
|
Decodes a URL percent encoded string.
Replaces all occurences of For example, the encoded string "%40%3F%3D%26%25" will be decoded to "@?=&%".
Definition at line 85 of file UrlUtils.cc. References decode_octet(), and ZYPP_THROW. Referenced by zypp::url::UrlBase::getFragment(), zypp::url::UrlBase::getHost(), zypp::url::UrlBase::getPassword(), zypp::url::UrlBase::getPathName(), zypp::url::UrlBase::getUsername(), and zypp::url::UrlBase::isValidHost(). |
|
Encode one character.
Encode the specified character
Definition at line 130 of file UrlUtils.cc. |
|
Decode one character.
Decode the Example: char *str = "%40"; char *pct = strchr(str, '%'); int chr = pct ? decode_octet(pct+1) : -1; // chr is set to the '@' ASCII character now.
Definition at line 147 of file UrlUtils.cc. Referenced by decode(). |
|
Split into a parameter vector.
Splits a parameter string
Usual parameter separators are
Definition at line 163 of file UrlUtils.cc. References ZYPP_THROW. Referenced by zypp::url::UrlBase::getPathParamsMap(), zypp::url::UrlBase::getPathParamsVec(), zypp::url::UrlBase::getQueryStringMap(), and zypp::url::UrlBase::getQueryStringVec(). |
|
Split into a parameter map.
Splits a parameter string
If a parameter substring doesn't contain any value separator
Usual parameter separators are
If the encoding flag
Definition at line 197 of file UrlUtils.cc. References ZYPP_THROW. |
|
Join parameter vector to a string.
Creates a string containing all substrings from the
Usual parameter separators are
Definition at line 252 of file UrlUtils.cc. References zypp::solver::detail::str. Referenced by zypp::url::UrlBase::setPathParamsMap(), zypp::url::UrlBase::setPathParamsVec(), zypp::url::UrlBase::setQueryStringMap(), and zypp::url::UrlBase::setQueryStringVec(). |
|
Join parameter map to a string.
Creates a string containing all parameter key-value pairs from the parameter map
Usual parameter separators are
See encode() function from details about the
Definition at line 273 of file UrlUtils.cc. References ZYPP_THROW. |