QKnxUtf8String Class

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

头: #include <QKnxUtf8String>
qmake: QT += knx
Since: Qt 5.11
继承: QKnxVariableSizeDatapointType
继承者:

QKnxUtf8

该类在 Qt 5.11 引入。

公共函数

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

重实现公共函数

virtual bool isValid () const override

保护函数

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

详细描述

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.

另请参阅 QKnxDatapointType , QKnxUtf8 ,和 Qt KNX Datapoint Type Classes .

成员函数文档编制

[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 .

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

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

QKnxUtf8String:: QKnxUtf8String (const QString & string )

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

QKnxUtf8String:: QKnxUtf8String ()

Creates a variable sized datapoint type.

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

重实现: QKnxDatapointType::isValid () const.

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.

另请参阅 string ().

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

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

size is -1 , the full string 被使用。

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.

另请参阅 setString ().