Static Public Member Functions

# HUpnpDataTypes Class Reference

An utility class for working with UPnP data types.

`#include <HUpnpDataTypes>`

List of all members.

## 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)

## 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:

  | dataTypeAsStr | specifies 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:

  | datatype | specifies the data type to be checked.

Return values:

  | true | if the specified data type is numeric.
  | false | in 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:

  | datatype | specifies the data type to be checked.

Return values:

  | true | if the specified data type is an integer.
  | false | in 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:

  | arg | specifies the data type to be checked.

Return values:

  | true | if the specified data type is a rational number.
  | false | in 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:

  | datatype | specifies the data type which string representation is requested.

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