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 ().