Gnash
0.8.10
|
Uniform Resource Locator. More...
#include <URL.h>
Public Member Functions | |
URL (const std::string &absolute_url) | |
Construct an URL from the given absolute url string. | |
URL (const std::string &relative_url, const URL &baseurl) | |
const std::string & | protocol () const |
Return the 'protocol' member of this URL, as a string. | |
const std::string & | hostname () const |
Return the 'hostname' member of this URL, as a string. | |
const std::string & | port () const |
Return the 'port' member of this URL, as a string. | |
const std::string & | path () const |
Return the 'path' member of this URL, as a string. | |
const std::string & | anchor () const |
Return the 'anchor' member of this URL, as a string. | |
const std::string & | querystring () const |
Return the 'querystring' member of this URL, as a string. | |
void | set_querystring (const std::string &value) |
Set the 'querystring' member of this URL to a new value. | |
std::string | str () const |
Return the full absolute URL as a string. | |
Static Public Member Functions | |
static void | parse_querystring (const std::string &query_string, std::map< std::string, std::string > &target_map) |
Parse a query string filling the provided map. | |
static void | encode (std::string &str) |
Encode a string to URL-encoded format converting all dodgy characters to AB hex sequences. | |
static std::string | encode (const std::string &str) |
Encode a string to URL-encoded format converting all dodgy characters to AB hex sequences. This merely uses the void encode() function on a new string. | |
static void | decode (std::string &str) |
Decode a string from URL-encoded format converting all hexadecimal sequences to ASCII characters. | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const URL &u) |
Uniform Resource Locator.
This class is used to manage URLs.
gnash::URL::URL | ( | const std::string & | absolute_url | ) |
gnash::URL::URL | ( | const std::string & | relative_url, |
const URL & | baseurl | ||
) |
const std::string& gnash::URL::anchor | ( | ) | const [inline] |
Return the 'anchor' member of this URL, as a string.
The anchor is the string after the '#' character
void gnash::URL::decode | ( | std::string & | str | ) | [static] |
Decode a string from URL-encoded format converting all hexadecimal sequences to ASCII characters.
A sequence to convert is % followed by two case-independent hexadecimal digits, which is replaced by the equivalent ASCII character. See RFC1738 http://www.rfc-editor.org/rfc/rfc1738.txt, Section 2.2 "URL Character Encoding Issues"
str | The input/output string |
References gnash::key::i.
Referenced by parse_querystring().
void gnash::URL::encode | ( | std::string & | str | ) | [static] |
Encode a string to URL-encoded format converting all dodgy characters to AB hex sequences.
Characters that need escaping are:
str | The input/output string |
References gnash::key::i, and gnash::key::c.
Referenced by gnash::getURLEncodedVars(), and encode().
std::string gnash::URL::encode | ( | const std::string & | str | ) | [static] |
const std::string& gnash::URL::hostname | ( | ) | const [inline] |
Return the 'hostname' member of this URL, as a string.
NOTE: return the empty string if protocol() is "file"
Referenced by gnash::OverwriteExisting::operator()(), gnash::IncrementalRename::operator()(), gnash::rtmp::RTMP::connect(), gnash::SharedObjectLibrary::SharedObjectLibrary(), gnash::SharedObjectLibrary::getLocal(), and gnash::URLAccessManager::allow().
void gnash::URL::parse_querystring | ( | const std::string & | query_string, |
std::map< std::string, std::string > & | target_map | ||
) | [static] |
Parse a query string filling the provided map.
query_string | the url-escaped query string (can include or not the starting question mark) |
target_map | A standard map to put parsed values into. Note: existing elements of the map will be replaced. |
References decode().
Referenced by nsPluginInstance::threadMain().
const std::string& gnash::URL::path | ( | ) | const [inline] |
Return the 'path' member of this URL, as a string.
The returned path starts with '/'
References _path.
Referenced by gnash::OverwriteExisting::operator()(), gnash::IncrementalRename::operator()(), main(), gnash::SharedObjectLibrary::SharedObjectLibrary(), gnash::SharedObjectLibrary::getLocal(), gnash::StreamProvider::getStream(), and gnash::URLAccessManager::allow().
const std::string& gnash::URL::port | ( | ) | const [inline] |
Return the 'port' member of this URL, as a string.
NOTE: return the empty string if the port isn't specified, as this is an optional field.
Referenced by gnash::rtmp::RTMP::connect().
const std::string& gnash::URL::protocol | ( | ) | const [inline] |
Return the 'protocol' member of this URL, as a string.
Referenced by gnash::StreamProvider::getStream(), and gnash::URLAccessManager::allow().
const std::string& gnash::URL::querystring | ( | ) | const [inline] |
Return the 'querystring' member of this URL, as a string.
The query is the string after the '?' character
Referenced by nsPluginInstance::threadMain().
void gnash::URL::set_querystring | ( | const std::string & | value | ) | [inline] |
Set the 'querystring' member of this URL to a new value.
std::string gnash::URL::str | ( | ) | const |
Return the full absolute URL as a string.
TODO: make output operator and operator+ for strings
Referenced by gnash::MovieFactory::makeMovie(), gnash::Player::run(), gnash::rtmp::RTMP::connect(), main(), gnash::StreamProvider::getStream(), and gnash::operator<<().
std::ostream& operator<< | ( | std::ostream & | o, |
const URL & | u | ||
) | [friend] |