Class that represents the service identifier of a UPnP service. More...
#include <HServiceId>
Public Member Functions | |
HServiceId () | |
HServiceId (const QString &serviceId) | |
HServiceId (const HServiceId &other) | |
HServiceId & | operator= (const HServiceId &other) |
~HServiceId () | |
bool | isValid (HValidityCheckLevel level) const |
bool | isStandardType () const |
QString | urn (bool completeUrn=true) const |
QString | suffix () const |
QString | toString () const |
Friends | |
H_UPNP_CORE_EXPORT bool | operator== (const HServiceId &, const HServiceId &) |
H_UPNP_CORE_EXPORT quint32 | qHash (const HServiceId &key) |
Related Functions | |
(Note that these are not member functions.) | |
H_UPNP_CORE_EXPORT bool | operator!= (const HServiceId &, const HServiceId &) |
Service identifiers are found in UPnP device descriptions and they use the following format within services defined by the UPnP Forum:
urn:upnp-org:serviceId:serviceID
In the above format only the tailing serviceID varies. Every service identifier of a standard service type has to begin with urn:upnp-org:serviceId:
.
With a vendor defined service the format for a service identifier is:
urn:domain-name:serviceId:serviceID
Note, according to the UDA specification Period characters in the Vendor Domain Name MUST be replaced with hyphens in accordance with RFC 2141.
In both formats, the last serviceID component is the service identifier suffix.
serviceID
to be exactly as defined in the UDA. However, you can call isValid() to check if the instance contains strictly valid information.HServiceId | ( | ) |
HServiceId | ( | const QString & | serviceId ) |
Constructs a new instance.
serviceId | specifies the contents of the object. If the provided argument is invalid an empty instance is created. For an object to be strictly valid the parameter has to follow either of the formats exactly: |
urn:upnp-org:serviceId:serviceID
for service identifiers belonging to a standard service type.urn:domain-name:serviceId:serviceID
for service identifiers belonging to a vendor defined service type.The postfix serviceID is the service identifier suffix.
HServiceId | ( | const HServiceId & | other ) |
Creates a new instance based on the other instance provided.
other | specifies the other instance. |
~HServiceId | ( | ) |
Destroys the instance.
HServiceId & operator= | ( | const HServiceId & | other ) |
Assigns the contents of the other instance to this.
other | specifies the other instance. |
bool isValid | ( | HValidityCheckLevel | level ) | const |
Indicates if the service identifier is properly defined.
level | specifies whether the contents of the object are checked for strict validity. Only an object that is strictly valid contains information as defined in the UDA. |
bool isStandardType | ( | ) | const |
Indicates whether the service identifier belongs to a standard service type defined by the UPnP forum or to a vendor defined service.
true | in case the service identifier belongs to a standard service type defined by the UPnP forum. |
false | in case the service identifier belongs to a vendor defined service type or the object is invalid. |
QString urn | ( | bool | completeUrn = true ) |
const |
Returns the URN of the service identifier.
completeUrn | specifies whether the prefix urn is returned as well. If the argument is false, only the actual URN is returned. i.e if the service identifier is defined as urn:upnp-org:serviceId:MyServiceId only upnp-org is returned. |
QString suffix | ( | ) | const |
Returns the service identifier suffix.
urn:upnp-org:serviceId:MyServiceId
, the suffix identifier and thus the value returned is "MyServiceId"
. If the object is not valid, an empty string is returned.QString toString | ( | ) | const |
Returns a string representation of the instance.
H_UPNP_CORE_EXPORT bool operator== | ( | const HServiceId & | , |
const HServiceId & | |||
) | [friend] |
Compares the two objects for equality.
H_UPNP_CORE_EXPORT quint32 qHash | ( | const HServiceId & | key ) | [friend] |
Returns a value that can be used as a unique key in a hash-map identifying the resource type object.
key | specifies the service ID from which the hash value is created. |
H_UPNP_CORE_EXPORT bool operator!= | ( | const HServiceId & | , |
const HServiceId & | |||
) | [related] |
Compares the two objects for inequality.