Herqq
|
Class that represents a network endpoint, which is a combination of a host address and a port number. More...
#include <HEndpoint>
Public Member Functions | |
HEndpoint () | |
HEndpoint (const QHostAddress &hostAddress) | |
HEndpoint (const QHostAddress &hostAddress, quint16 portNumber) | |
HEndpoint (const QUrl &url) | |
HEndpoint (const QString &arg) | |
~HEndpoint () | |
bool | isNull () const |
QHostAddress | hostAddress () const |
quint16 | portNumber () const |
bool | isMulticast () const |
QString | toString () const |
Friends | |
H_UPNP_CORE_EXPORT bool | operator== (const HEndpoint &, const HEndpoint &) |
H_UPNP_CORE_EXPORT quint32 | qHash (const HEndpoint &) |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator!= (const HEndpoint &obj1, const HEndpoint &obj2) |
Class that represents a network endpoint, which is a combination of a host address and a port number.
HEndpoint | ( | ) |
Creates a new instance with host address set to QHostAddress::Null
and port set to "0".
HEndpoint | ( | const QHostAddress & | hostAddress | ) |
Creates a new instance with the specified host address and port set to zero.
hostAddress | specifies the host address. |
HEndpoint | ( | const QHostAddress & | hostAddress, |
quint16 | portNumber | ||
) |
Creates a new instance with the specified host address and port.
hostAddress | specifies the host address. If the host address is null the port number is set to zero. |
portNumber | specifies the port number. |
HEndpoint | ( | const QUrl & | url | ) |
Creates a new instance from the specified url.
url | specifies the url from which the endpoint and port information is extracted (if present). If the URL does not contain a valid host information the port number is set to zero. |
HEndpoint | ( | const QString & | arg | ) |
Creates a new instance from the specified string.
following format "hostAddress:portNumber", where [:portNumber] is optional.
arg | specifies the string following format "hostAddress:portNumber", where [:portNumber] is optional. If the hostAddress is QHostAddress::Null the port number is set to zero. |
~HEndpoint | ( | ) |
Destroys the instance.
bool isNull | ( | ) | const [inline] |
Indicates whether or not the end point is properly defined.
QHostAddress hostAddress | ( | ) | const [inline] |
Returns the host address of the endpoint.
quint16 portNumber | ( | ) | const [inline] |
Returns the port number of the endpoint.
bool isMulticast | ( | ) | const |
Indicates whether or not the end point refers to a multicast address.
QString toString | ( | ) | const |
Returns a string representation of the endpoint.
"192.168.0.1:80"
. If the instance is null, i.e. isNull() returns true then an empty string is returned. Compares the two objects for equality.
H_UPNP_CORE_EXPORT quint32 qHash | ( | const HEndpoint & | ) | [friend] |
Returns a value that can be used as a unique key in a hash-map identifying the object.
key | specifies the object from which the hash value is created. |