This class represents a product token as defined in the RFC 2616, section 3.8. More...
#include <HProductToken>
Public Member Functions | |
HProductToken () | |
HProductToken (const QString &token, const QString &productVersion) | |
~HProductToken () | |
bool | isValid (HValidityCheckLevel checkLevel) const |
QString | token () const |
QString | version () const |
QString | toString () const |
bool | isValidUpnpToken () |
qint32 | minorVersion () |
qint32 | majorVersion () |
Friends | |
H_UPNP_CORE_EXPORT bool | operator== (const HProductToken &obj1, const HProductToken &obj2) |
Related Functions | |
(Note that these are not member functions.) | |
H_UPNP_CORE_EXPORT bool | operator!= (const HProductToken &, const HProductToken &) |
HProductToken | ( | ) |
Creates a new, empty instance.
An object created with the default constructor is invalid.
HProductToken | ( | const QString & | token, |
const QString & | productVersion | ||
) |
Creates a new object based on the provided token data.
If the token data is invalid, the object will be invalid as well.
token | specifies the token part, which is supposed to identify a product. If this is empty, the created object will be invalid. |
productVersion | specifies the version part. If this is empty, the created object will be invalid. |
~HProductToken | ( | ) |
Destroys the instance.
bool isValid | ( | HValidityCheckLevel | checkLevel ) | const |
Indicates if the object is valid, i.e both the token and the product version are defined.
checkLevel | 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. In other words, a strictly valid product token takes the form UPnP/majorVersion.minorVersion , where currently major version is always 1 and minor version is either 0 or 1. |
QString token | ( | ) | const [inline] |
Returns the token part.
"Apache"
. An empty string is returned in case the object is invalid.QString version | ( | ) | const [inline] |
Returns the version part.
"1.0"
. An empty string is returned in case the object is invalid.QString toString | ( | ) | const |
Returns a string representation of the object.
The format of the returned string is "token"/"version"
.
bool isValidUpnpToken | ( | ) |
Indicates if the provided product token is a valid UPnP \ token.
qint32 minorVersion | ( | ) |
Attempts to parse the version part of a product token to a major and minor component and returns the minor component if the function succeeded.
For the function to succeed the specified product token has to contain a version string that follows the format "major.minor". The function ignores any further "version information" after the "minor" component separated by a dot. The "minor" component has to be convertible to an integer.
qint32 majorVersion | ( | ) |
Attempts to parse the version part of a product token to a major and minor component and returns the major component if the function succeeded.
For the function to succeed the specified product token has to contain a version string that either
H_UPNP_CORE_EXPORT bool operator== | ( | const HProductToken & | obj1, |
const HProductToken & | obj2 | ||
) | [friend] |
Compares the two objects for equality.
H_UPNP_CORE_EXPORT bool operator!= | ( | const HProductToken & | , |
const HProductToken & | |||
) | [related] |
Compares the two objects for inequality.