|
Public Types |
typedef std::map< std::string,
std::string > | OptionMapType |
enum | Protocol {
unknown,
file,
ftp,
http,
https,
cd,
dvd,
nfs,
dir,
hd,
smb,
cifs
} |
Public Member Functions |
| Url () |
| Url (const std::string &url) |
| ~Url () |
bool | operator== (const Url &) const |
void | setProtocol (Protocol) |
void | setProtocolString (const std::string &str) |
void | setUsername (const std::string &str) |
void | setPassword (const std::string &str) |
void | setHost (const std::string &str) |
void | setPort (int) |
void | setPath (const std::string &path) |
Protocol | protocol () const |
const std::string & | protocolString () const |
const std::string & | username () const |
const std::string & | password () const |
const std::string & | host () const |
int | port () const |
const std::string & | path () const |
const OptionMapType & | options () const |
std::string | option (const std::string &key) const |
bool | isLocal () const |
bool | isValid () const |
bool | set (const std::string url) |
std::string | asString (bool path=true, bool options=true, bool plainpassword=false) const |
std::string | saveAsString () const |
Static Public Member Functions |
Protocol | stringToProtocol (const std::string &protocolString) |
std::string | protocolToString (Protocol) |
Private Member Functions |
void | clearifinvalid (bool valid) |
Static Private Member Functions |
bool | split (const std::string &url, Protocol &protocol, std::string &protocolString, std::string &username, std::string &password, std::string &hostname, int &port, std::string &path, OptionMapType &options) |
Private Attributes |
Protocol | _protocol |
std::string | _protocolString |
std::string | _username |
std::string | _password |
std::string | _host |
int | _port |
std::string | _path |
OptionMapType | _options |
bool | _valid |
Static Private Attributes |
ProtocolStrings | _protocolStrings |
Friends |
std::ostream & | operator<< (std::ostream &str, const Url &obj) |
TODO: (un)escaping special characters like space -> 20 TODO: check if url is still valid when using set* functions