Library: UPnP
Package: Core
Header: Poco/UPnP/URN.h
A Uniform Resource Name, or URN, is a variant of an URI that stores a structured name used to identify an entity. In UPnP, URNs are used to identify devices, device types and service types, as well as SSDP notification types.
This class is used to create and parse the different kinds of URNs used by UPnP:
URN supports full value semantics, including comparison operators. Note, however, that copying URN values may be expensive.
Member Functions: clear, domain, empty, majorVersion, matches, minorVersion, name, operator !=, operator <, operator <=, operator =, operator ==, operator >, operator >=, scheme, swap, toString, type, uuid, version
URN_UUID = 0
uuid:<device-UUID>
upnp:rootdevice
urn:<domain-name>:device:<type>:<version>
urn:<domain-name>:service:<type>:<version>
urn:upnp-org:serviceId:<serviceId>
URN();
Creates an empty URN.
Creates a root device URN.
Note: type must always be URN_ROOT_DEVICE.
Creates a URN by copying another one.
explicit URN(
const std::string & urn
);
Creates a URN by parsing the given string.
URN(
const Poco::UUID & uuid
);
URN(
Type type,
const std::string & serviceId
);
Creates a URN of type URN_SERVICEID using the given serviceId.
Type must be URN_SERVICEID.
URN(
Type type,
const std::string & name,
const std::string & version
);
Creates a URN of type URN_DEVICE or URN_SERVICE, using the given name and version. The domain is set to "schemas-upnp-org".
Type must be URN_DEVICE or URN_SERVICE.
URN(
Type type,
const std::string & domain,
const std::string & name,
const std::string & version
);
Creates a URN of type URN_DEVICE or URN_SERVICE, using the given domain, name and version.
Type must be URN_DEVICE or URN_SERVICE.
~URN();
Destroys the URN.
void clear();
Clears the URN.
const std::string & domain() const;
Returns the URN domain part (e.g. "schemas-upnp-org").
bool empty() const;
Returns true if and only if the URN is empty.
int majorVersion() const;
Returns the major version number.
A version is set for types URN_DEVICE and URN_SERVICE only.
bool matches(
const URN & urn
) const;
Compares type, scheme, domain and name and checks whether this URN's version is greater or equal to urn's version.
bool matches(
const std::string & urn
) const;
Compares type, scheme, domain and name and checks whether this URN's version is greater or equal to urn's version.
int minorVersion() const;
Returns the minor version number.
A version is set for types URN_DEVICE and URN_SERVICE only.
const std::string & name() const;
Returns the name of the service/device.
bool operator != (
const URN & urn
) const;
bool operator != (
const std::string & urn
) const;
bool operator < (
const URN & urn
) const;
bool operator < (
const std::string & urn
) const;
bool operator <= (
const URN & urn
) const;
bool operator <= (
const std::string & urn
) const;
URN & operator = (
const URN & urn
);
Assignment operator.
URN & operator = (
const std::string & urn
);
Parses an URN from the given string and assigns it.
bool operator == (
const URN & urn
) const;
bool operator == (
const std::string & urn
) const;
bool operator > (
const URN & urn
) const;
bool operator > (
const std::string & urn
) const;
bool operator >= (
const URN & urn
) const;
bool operator >= (
const std::string & urn
) const;
const std::string & scheme() const;
Returns the URN scheme part, which will be one of "uuid", "upnp" or "urn".
void swap(
URN & urn
);
Exchanges the URN with another one.
const std::string & toString() const;
Converts a URN to a string.
URN::Type type() const;
Returns the type of the URN.
const Poco::UUID & uuid() const;
const std::string & version() const;
Returns the version string (<major>.<minor>).
A version is set for types URN_DEVICE and URN_SERVICE only.
static const std::string DEVICE;
static const std::string ROOTDEVICE;
static const std::string SCHEMAS_UPNP_ORG;
static const std::string SERVICE;
static const std::string SERVICEID;
static const std::string UPNP_ORG;
static const std::string UPNP_SCHEME;
static const std::string URN_SCHEME;
static const std::string UUID_SCHEME;