Herqq
Public Types | Static Public Member Functions

HUpnpDataTypes Class Reference

An utility class for working with UPnP data types. More...

#include <HUpnpDataTypes>

List of all members.

Public Types

enum  DataType {
  Undefined = 0, ui1, ui2, ui4 ,
  i2, i4, integer, r4,
  r8, number, fixed_14_4, fp,
  character, string, date, dateTime,
  dateTimeTz, time, timeTz, boolean,
  bin_base64, bin_hex, uri, uuid
}
typedef quint8 ui1T
typedef quint16 ui2T
typedef quint32 ui4T
typedef qint8 i1T
typedef qint16 i2T
typedef qint32 i4T
typedef i4T integerT
typedef float r4T
typedef qreal r8T
typedef r8T numberT
typedef qreal fixed_14_4T
typedef float fpT
typedef char characterT
typedef QString stringT
typedef QDate dateT
typedef QDateTime dateTimeT
typedef QTime timeT
typedef QTime time_tzT
typedef bool booleanT
typedef QByteArray bin_base64T
typedef QByteArray bin_hexT
typedef QUrl uriT
typedef QUuid uuidT

Static Public Member Functions

static const QString & ui1_str ()
static const QString & ui2_str ()
static const QString & ui4_str ()
static const QString & i1_str ()
static const QString & i2_str ()
static const QString & i4_str ()
static const QString & integer_str ()
static const QString & r4_str ()
static const QString & r8_str ()
static const QString & number_str ()
static const QString & fixed_14_4_str ()
static const QString & fp_str ()
static const QString & character_str ()
static const QString & string_str ()
static const QString & date_str ()
static const QString & dateTime_str ()
static const QString & dateTimeTz_str ()
static const QString & time_str ()
static const QString & time_tz_str ()
static const QString & boolean_str ()
static const QString & bin_base64_str ()
static const QString & bin_hex_str ()
static const QString & uri_str ()
static const QString & uuid_str ()
static DataType dataType (const QString &dataTypeAsStr)
static bool isNumeric (DataType datatype)
static bool isInteger (DataType datatype)
static bool isRational (DataType arg)
static QString toString (DataType datatype)

Detailed Description

An utility class for working with UPnP data types.


Member Typedef Documentation

typedef quint8 ui1T

Type definition for a DataType::ui1.

typedef quint16 ui2T

Type definition for a DataType::ui2.

typedef quint32 ui4T

Type definition for a DataType::ui4.

typedef qint8 i1T

Type definition for a DataType::i1.

typedef qint16 i2T

Type definition for a DataType::i2.

typedef qint32 i4T

Type definition for a DataType::i4.

typedef i4T integerT

Type definition for a DataType::integer.

typedef float r4T

Type definition for a DataType::r4.

typedef qreal r8T

Type definition for a DataType::r8.

typedef r8T numberT

Type definition for a DataType::number.

typedef qreal fixed_14_4T

Type definition for a DataType::fixed_14_4.

typedef float fpT

Type definition for a DataType::fp.

typedef char characterT

Type definition for a DataType::char.

typedef QString stringT

Type definition for a DataType::string.

typedef QDate dateT

Type definition for a DataType::date.

typedef QDateTime dateTimeT

Type definition for a DataType::dateTime.

typedef QTime timeT

Type definition for a DataType::time.

typedef QTime time_tzT

Type definition for a DataType::timeTz.

typedef bool booleanT

Type definition for a DataType::boolean.

typedef QByteArray bin_base64T

Type definition for a DataType::bin_base64.

typedef QByteArray bin_hexT

Type definition for a DataType::bin_hex.

typedef QUrl uriT

Type definition for a DataType::uri.

typedef QUuid uuidT

Type definition for a DataType::uuid.


Member Enumeration Documentation

enum DataType

This enum type defines the UPnP data types set by the UPnP Device Architecture v1.1 specification.

Enumerator:
Undefined 

Undefined, illegal data type.

ui1 

Unsigned 1 Byte int.

Same format as int without leading sign.

ui2 

Unsigned 2 Byte int.

Same format as int without leading sign.

ui4 

Unsigned 4 Byte int.

Same format as int without leading sign.

1 Byte int. Same format as int.

i2 

2 Byte int.

Same format as int.

i4 

4 Byte int.

Same format as int. MUST be between -2147483648 and 2147483647.

integer 

Fixed point, integer number.

r4 

4 Byte float.

Same format as float. MUST be between 3.40282347E+38 to 1.17549435E-38.

r8 

8 Byte float.

Same format as float. MUST be between -1.79769313486232E308 and - 4.94065645841247E-324 for negative values, and between 4.94065645841247E-324 and 1.79769313486232E308 for positive values, i.e., IEEE 64-bit (8-Byte) double.

number 

Same as r8.

fixed_14_4 

Same as r8 but no more than 14 digits to the left of the decimal point and no more than 4 to the right.

fp 

Floating point number.

Mantissa (left of the decimal) and/or exponent MAY have a leading sign. Mantissa and/or exponent MAY have leading zeros, which SHOULD be ignored by the recipient. Decimal character in mantissa is a period, i.e., whole digits in mantissa separated from fractional digits by period ("."). Mantissa separated from exponent by "E".

character 

Unicode string.

One character long.

string 

Unicode string.

No limit on length.

date 

Date in a subset of ISO 8601 format without time data.

dateTime 

Date in ISO 8601 format with OPTIONAL time but no time zone.

dateTimeTz 

Date in ISO 8601 format with OPTIONAL time and OPTIONAL time zone.

time 

Time in a subset of ISO 8601 format with no date and no time zone.

timeTz 

Time in a subset of ISO 8601 format with OPTIONAL time zone but no date.

boolean 

"0" for false or "1" for true.

The values "true", "yes", "false", or "no" are deprecated and MUST NOT be sent but MUST be accepted when received. When received, the values "true" and "yes" MUST be interpreted as true and the values "false" and "no" MUST be interpreted as false.

bin_base64 

MIME-style Base64 encoded binary BLOB.

Takes 3 Bytes, splits them into 4 parts, and maps each 6 bit piece to an octet. (3 octets are encoded as 4.) No limit on size.

bin_hex 

Hexadecimal digits representing octets.

Treats each nibble as a hex digit and encodes as a separate Byte. (1 octet is encoded as 2.) No limit on size.

uri 

Universal Resource Identifier.

uuid 

Universally Unique ID.


Member Function Documentation

static const QString& ui1_str ( ) [inline, static]

The string identifier for an unsigned 1 byte int.

See also:
DataType::ui1
static const QString& ui2_str ( ) [inline, static]

The string identifier for an unsigned 2 byte int.

See also:
DataType::ui2
static const QString& ui4_str ( ) [inline, static]

The string identifier for an unsigned 4 byte int.

See also:
DataType::ui4
static const QString& i1_str ( ) [inline, static]

The string identifier for a 1 byte int.

See also:
DataType::i1
static const QString& i2_str ( ) [inline, static]

The string identifier for a 2 byte int.

See also:
DataType::i2
static const QString& i4_str ( ) [inline, static]

The string identifier for a 4 byte int.

See also:
DataType::i4
static const QString& integer_str ( ) [inline, static]

The string identifier for a fixed point, integer number.

See also:
DataType::integer
static const QString& r4_str ( ) [inline, static]

The string identifier for a 4 byte float.

See also:
DataType::r4
static const QString& r8_str ( ) [inline, static]

The string identifier for a 8 byte float.

See also:
DataType::r8
static const QString& number_str ( ) [inline, static]

The string identifier for a 8 byte float.

This is an alias for r8.

See also:
DataType::number
static const QString& fixed_14_4_str ( ) [inline, static]

The string identifier for a 8 byte float that has no more than 14 digits to the left of the decimal point and no more than 4 to the right.

See also:
DataType::fixed_14_4
static const QString& fp_str ( ) [inline, static]

The string identifier for a floating point number.

See also:
DataType::fp
static const QString& character_str ( ) [inline, static]

The string identifier for a unicode string that is one character long.

See also:
DataType::char
static const QString& string_str ( ) [inline, static]

The string identifier for a unicode string that has no limit on length.

See also:
DataType::string
static const QString& date_str ( ) [inline, static]

The string identifier for a date in a subset of ISO 8601 format without time data.

See also:
DataType::date
static const QString& dateTime_str ( ) [inline, static]

The string identifier for a date in ISO 8601 format with OPTIONAL time but no time zone.

See also:
DataType::dateTime
static const QString& dateTimeTz_str ( ) [inline, static]

The string identifier for a date in ISO 8601 format with OPTIONAL time and OPTIONAL time zone.

See also:
DataType::dateTimeTz
static const QString& time_str ( ) [inline, static]

The string identifier for a time in a subset of ISO 8601 format with no date and no time zone.

See also:
DataType::time
static const QString& time_tz_str ( ) [inline, static]

The string identifier for a time in a subset of ISO 8601 format with OPTIONAL time zone but no date.

See also:
DataType::timeTz
static const QString& boolean_str ( ) [inline, static]

The string identifier for a boolean.

See also:
DataType::boolean
static const QString& bin_base64_str ( ) [inline, static]

The string identifier for a MIME-style Base64 encoded binary BLOB.

See also:
DataType::bin_base64
static const QString& bin_hex_str ( ) [inline, static]

The string identifier for a hexadecimal digits representing octets.

See also:
DataType::bin_hex
static const QString& uri_str ( ) [inline, static]

The string identifier for a universal Resource Identifier.

See also:
DataType::uri
static const QString& uuid_str ( ) [inline, static]

The string identifier for a universally Unique ID.

See also:
DataType::uuid
HUpnpDataTypes::DataType dataType ( const QString &  dataTypeAsStr) [static]

Returns the UPnP data type enum value that matches the content of the specified string, if any.

Parameters:
dataTypeAsStrspecifies the "name" of the UPnP data type as string. For example, the string could contain "i4", which in the UDA v1.1 specification is defined as 4-byte signed integer.
Returns:
The UPnP data type enum value that matches the content of the specified string. If the specified string does not correspond to any UPnP data type, HUpnpDataTypes::Undefined is returned.
static bool isNumeric ( DataType  datatype) [inline, static]

Indicates whether or not the specified data type is numeric.

Parameters:
datatypespecifies the data type to be checked.
Return values:
trueif the specified data type is numeric.
falsein case the data type is not numeric or it is undefined.
static bool isInteger ( DataType  datatype) [inline, static]

Indicates whether or not the specified data type is an integer.

Parameters:
datatypespecifies the data type to be checked.
Return values:
trueif the specified data type is an integer.
falsein case the data type is not an integer or it is undefined.
static bool isRational ( DataType  arg) [inline, static]

Indicates whether or not the specified data type is a rational number.

Parameters:
argspecifies the data type to be checked.
Return values:
trueif the specified data type is a rational number.
falsein case the data type is not rational or it is undefined.
QString toString ( DataType  datatype) [static]

Returns the UDA defined string representation of the specified data type.

Parameters:
datatypespecifies the data type which string representation is requested.
Returns:
The UDA defined string representation of the specified data type.