glibmm  2.62.0
About: glibmm is a set of C++ bindings for glib, including cross-platform APIs such as a std::string-like UTF8 string class, string utility methods, such as a text encoding converter API, file access, and threads.
  Fossies Dox: glibmm-2.62.0.tar.xz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

URI Utilities

Various uri-related functions. More...

Functions

std::string Glib::uri_unescape_string (const std::string &escaped_string, const std::string &illegal_characters=std::string())
 Unescapes a whole escaped string. More...
 
std::string Glib::uri_parse_scheme (const std::string &uri)
 Gets the scheme portion of a URI. More...
 
std::string Glib::uri_escape_string (const std::string &unescaped, const std::string &reserved_chars_allowed=std::string(), bool allow_utf8=true)
 Escapes a string for use in a URI. More...
 

Detailed Description

Various uri-related functions.

Function Documentation

◆ uri_escape_string()

std::string Glib::uri_escape_string ( const std::string &  unescaped,
const std::string &  reserved_chars_allowed = std::string(),
bool  allow_utf8 = true 
)

Escapes a string for use in a URI.

Normally all characters that are not "unreserved" (i.e. ASCII alphanumerical characters plus dash, dot, underscore and tilde) are escaped. But if you specify characters in reserved_chars_allowed they are not escaped. This is useful for the "reserved" characters in the URI specification, since those are allowed unescaped in some portions of a URI.

Parameters
unescapedThe unescaped input string.
reserved_chars_allowedA string of reserved characters that are allowed to be used.
allow_utf8true if the result can include UTF-8 characters.
Returns
An escaped version of unescaped.
Since @PACKAGE_NAME@ 2.16:

Definition at line 46 of file uriutils.cc.

◆ uri_parse_scheme()

std::string Glib::uri_parse_scheme ( const std::string &  uri)

Gets the scheme portion of a URI.

RFC 3986 decodes the scheme as:

URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

Common schemes include "file", "http", "svn+ssh", etc.

Parameters
uri
Returns
The "Scheme" component of the URI, or an empty string on error.
Since @PACKAGE_NAME@ 2.16:

Definition at line 40 of file uriutils.cc.

◆ uri_unescape_string()

std::string Glib::uri_unescape_string ( const std::string &  escaped_string,
const std::string &  illegal_characters = std::string() 
)

Unescapes a whole escaped string.

If any of the characters in illegal_characters or the character zero appears as an escaped character in escaped_string then that is an error and an empty string will be returned. This is useful it you want to avoid, for instance, having a slash being expanded in an escaped path element, which might confuse pathname handling.

Parameters
escaped_stringAn escaped string to be unescaped.
illegal_charactersAn optional string of illegal characters not to be allowed.
Returns
An unescaped version of escaped_string.
Since @PACKAGE_NAME@ 2.16:

Definition at line 33 of file uriutils.cc.