Global Classes
class qi::Url
Url
()Url
(const std::string& url)Url
(const std::string& url, unsigned short int defaultPort)Url
(const std::string& url, const std::string& defaultProtocol)Url
(const std::string& url, const std::string& defaultProtocol, unsigned short int defaultPort)~Url
()isValid
() conststr
() constprotocol
() consthasProtocol
() constsetProtocol
(const std::string& protocol)host
() consthasHost
() constsetHost
(const std::string& host)port
() consthasPort
() constsetPort
(unsigned short int port)qi::Url is an address represented by a protocol, a host and a port. The class isn’t compliant with RFC 3986. qi::Url can parse the following formats:
This class is copyable.
qi::Url::
Url
()¶Creates an empty url.
qi::Url::
Url
(const std::string& url)¶Brief:
Parameters: |
|
---|
qi::Url::
Url
(const std::string& url, unsigned short int defaultPort)¶Brief:
Parameters: |
|
---|
qi::Url::
Url
(const std::string& url, const std::string& defaultProtocol)¶Brief:
Parameters: |
|
---|
qi::Url::
Url
(const std::string& url, const std::string& defaultProtocol, unsigned short int defaultPort)¶Brief:
Parameters: |
|
---|
qi::Url::
~Url
()¶qi::Url::
isValid
() const
¶Brief:
Returns: | True if the protocol, host and port have been set. |
---|
qi::Url::
str
() const
¶Brief:
Returns: | The url string used by the Url class, the port and/or the protocol may have been appended if they had been given in the constructor. |
---|
qi::Url::
protocol
() const
¶Brief:
Returns: | The protocol of the url or an empty string if no protocol was set. |
---|
qi::Url::
hasProtocol
() const
¶Brief:
Returns: | True if the protocol was set. |
---|
qi::Url::
setProtocol
(const std::string& protocol)¶Sets the protocol to the given protocol identifier (tcp, tcps, udp, ...).
qi::Url::
host
() const
¶Brief:
Returns: | The host part of the url or an empty string if no host part was found. |
---|
qi::Url::
hasHost
() const
¶Brief:
Returns: | True if the host was set. |
---|
qi::Url::
setHost
(const std::string& host)¶Sets the host.
qi::Url::
port
() const
¶Brief:
Returns: | The port of the url, 0 if no port were given. |
---|
qi::Url::
hasPort
() const
¶Brief:
Returns: | True if the port was set. |
---|
qi::Url::
setPort
(unsigned short int port)¶Sets the port. You can use 0.