QKnxUtf8String Class

The QKnxUtf8String class is a datapoint type for a UTF-8 string. More...

Header: #include <QKnxUtf8String>
qmake: QT += knx
Since: Qt 5.11
Inherits: QKnxVariableSizeDatapointType
Inherited By:

QKnxUtf8

Public Functions

QKnxUtf8String()
QKnxUtf8String(const QString &string)
QKnxUtf8String(const char *string, int size = -1)
bool setString(const QString &string)
bool setString(const char *string, int size = -1)
QString string() const

Reimplemented Public Functions

virtual bool isValid() const override

Protected Functions

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

Additional Inherited Members

Detailed Description

The QKnxUtf8String class is a datapoint type for a UTF-8 string.

This datapoint type stores a UTF-8 (Unicode Transformation Format-8) string. The data length for one character can vary from 1 to 4 octets. Each character is encoded according to UTF-8.

This is a variable sized datapoint type.

See also QKnxDatapointType, QKnxUtf8, and Qt KNX Datapoint Type Classes.

Member Function Documentation

QKnxUtf8String::QKnxUtf8String()

Creates a variable sized datapoint type.

QKnxUtf8String::QKnxUtf8String(const QString &string)

Creates a variable sized datapoint type that stores the string string.

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

Creates a variable sized datapoint type that stores the string string with the length size.

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

Creates a variable sized datapoint type with the sub type subType that stores the string string with the length size.

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

Reimplemented from QKnxDatapointType::isValid().

bool QKnxUtf8String::setString(const QString &string)

Sets the string stored in the datapoint type to string.

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

See also string().

bool QKnxUtf8String::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 string contains invalid UTF-8 sequences, returns false and does not set the string.

QString QKnxUtf8String::string() const

Returns the string stored in the datapoint type.

See also setString().

© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.