QKnxCharString Class

The QKnxCharString class is a datapoint type that encodes a string. More...

Header: #include <QKnxCharString>
qmake: QT += knx
Inherits: QKnxFixedSizeDatapointType
Inherited By:

QKnxCharString88591 and QKnxCharStringASCII

Public Functions

QKnxCharString(const char *string, int size = -1)
QKnxCharString(QLatin1String string)
QKnxCharString()
bool setString(QLatin1String string)
bool setString(const char *string, int size = -1)
QLatin1String string() const

Reimplemented Public Functions

virtual bool isValid() const override

Protected Functions

QKnxCharString(int subType, const char *string, int size)

Detailed Description

This datapoint type encodes a string of QKnxChar. The encoding of the string is specified in QKnxCharStringASCII and QKnxCharString88591.

This is a fixed size datapoint type with the length of 14 bytes.

The range for the string size is from 0 to 14.

See also QKnxDatapointType, QKnxVarString, QKnxVarString88591, and Qt KNX Datapoint Type Classes.

Member Function Documentation

[protected] QKnxCharString::QKnxCharString(int subType, const char *string, int size)

Creates a fixed size datapoint type with the subtype subType, storing the string string with the length size.

QKnxCharString::QKnxCharString(const char *string, int size = -1)

Creates a fixed size datapoint type storing the string string with the length size.

QKnxCharString::QKnxCharString(QLatin1String string)

Creates a fixed size datapoint type storing the string string.

QKnxCharString::QKnxCharString()

Creates a fixed size datapoint type with the value set to 0.

[override virtual] bool QKnxCharString::isValid() const

Reimplements: QKnxDatapointType::isValid() const.

bool QKnxCharString::setString(QLatin1String string)

Sets the string stored in the datapoint type to string.

Returns true if the value was set; otherwise returns false.

See also string().

bool QKnxCharString::setString(const char *string, int size = -1)

Sets the string stored in the datapoint type to string with the length size.

If size is -1, the full string is used.

If the value is outside the allowed range, returns false and does not set the string.

QLatin1String QKnxCharString::string() const

Returns the string stored in the datapoint type.

See also setString().