Compatability with RSS
URLs can be instantiated from strings containing an rssd pseudo-URL
or code's deprecated protocol-plus-rssd-URL:
http://joe:blow@example.com:81/loc/script.php?var=val&foo=bar#herescheme (http) user (joe) pass (blow) host (example.com) port (81) path (/loc/script.php) query (query["var"] == "val"; query["foo"] == "bar") fragment (here)
Public Member Functions | |
| URL () | |
| ~URL () | |
| URL (const char *s) | |
| URL (const std::string &s) | |
| URL & | operator= (const std::string &) |
| URL & | operator= (const char *s) |
| bool | operator< (const URL &that) const |
| bool | operator== (const URL &) const |
| bool | operator!= (const URL &) const |
| URL & | operator+= (const std::string &add) |
| std::string | toString () const |
| Returns a string form of the URL, much as you'd see in the URL entry field of a web browser. | |
| std::string | getBaseName () const |
| Gets path's basename. | |
| std::string | getDirName () const |
| Gets path's dirname. | |
| std::string | getSuffix () const |
| Returns path's suffix. | |
| std::string | getSuffixLC () const |
| Returns path's suffix in all lowercase. | |
| std::string | getQuery (const std::string &key) const |
| bool | hasQuery (const std::string &key) const |
| bool | empty () const |
| bool | isLocal () const |
| void | setQuery (const std::string &key, int val) |
| void | setQuery (const std::string &key, const std::string &val) |
| void | removeSuffix () |
Static Public Member Functions | |
| static URL | fromHostFileName (const std::string &host, const std::string &file) |
Public Attributes | |
| std::string | scheme |
| The scheme of the url, such as ftp, http, file, or rssd. | |
| std::string | user |
| Optional username. | |
| std::string | pass |
| Optional username. | |
| std::string | host |
| Hostname of the machine to be accessed. | |
| int | port |
| The port to connect to host on. | |
| std::string | path |
| Path to the file, including directory and basename. | |
| std::map< std::string, std::string > | query |
| Arguments to be passed along when accessing the URL. | |
| std::string | fragment |
| Sub-part of the URL to skip to. | |
Friends | |
| std::ostream & | operator<< (std::ostream &, const code::URL &) |
| code::URL::URL | ( | ) | [inline] |
| code::URL::~URL | ( | ) | [inline] |
| code::URL::URL | ( | const char * | s | ) | [inline] |
| code::URL::URL | ( | const std::string & | s | ) | [inline] |
| bool code::URL::empty | ( | ) | const |
| static URL code::URL::fromHostFileName | ( | const std::string & | host, | |
| const std::string & | file | |||
| ) | [static] |
| std::string code::URL::getBaseName | ( | ) | const |
Gets path's basename.
For example, if path is /tmp/filename.txt.bz2, then filename.txt.bz2 will be returned.
| std::string code::URL::getDirName | ( | ) | const |
Gets path's dirname.
For example, if path is /tmp/filename.txt.bz2, then /tmp will be returned.
| std::string code::URL::getQuery | ( | const std::string & | key | ) | const |
| std::string code::URL::getSuffix | ( | ) | const |
Returns path's suffix.
For example, if path is /tmp/filename.txt.bz2, then bz2 will be returned.
| std::string code::URL::getSuffixLC | ( | ) | const |
Returns path's suffix in all lowercase.
For example, if path is /tmp/filename.txt.BZ2, then bz2 will be returned. This is to simplify string equality comparisons with getSuffix().
| bool code::URL::hasQuery | ( | const std::string & | key | ) | const [inline] |
| bool code::URL::isLocal | ( | ) | const |
| bool code::URL::operator!= | ( | const URL & | ) | const |
| URL& code::URL::operator+= | ( | const std::string & | add | ) |
| bool code::URL::operator< | ( | const URL & | that | ) | const [inline] |
| URL& code::URL::operator= | ( | const char * | s | ) |
| URL& code::URL::operator= | ( | const std::string & | ) |
| bool code::URL::operator== | ( | const URL & | ) | const |
| void code::URL::removeSuffix | ( | ) | [inline] |
| void code::URL::setQuery | ( | const std::string & | key, | |
| const std::string & | val | |||
| ) | [inline] |
| void code::URL::setQuery | ( | const std::string & | key, | |
| int | val | |||
| ) |
| std::string code::URL::toString | ( | ) | const |
| std::ostream& operator<< | ( | std::ostream & | , | |
| const code::URL & | ||||
| ) | [friend] |
| std::string code::URL::fragment |
Sub-part of the URL to skip to.
Currently unused by WDSSII.
| std::string code::URL::host |
Hostname of the machine to be accessed.
An empty string or localhost implies the file is local.
| std::string code::URL::pass |
Optional username.
Use if authentication is needed.
| std::string code::URL::path |
Path to the file, including directory and basename.
| int code::URL::port |
The port to connect to host on.
| std::map< std::string, std::string > code::URL::query |
Arguments to be passed along when accessing the URL.
| std::string code::URL::scheme |
The scheme of the url, such as ftp, http, file, or rssd.
| std::string code::URL::user |
Optional username.
Use if authentication is needed.
1.4.7