QMqttTopicName Class

The QMqttTopicName class represents a MQTT topic name. 更多...

頭: #include <QMqttTopicName>
qmake: QT += mqtt

注意: 此類的所有函數 可重入 .

公共函數

QMqttTopicName (const QMqttTopicName & name )
QMqttTopicName (const QLatin1String & name )
QMqttTopicName (const QString & name = QString())
QMqttTopicName & operator= (const QMqttTopicName & name )
~QMqttTopicName ()
bool isValid () const
int levelCount () const
QStringList levels () const
QString name () const
void setName (const QString & name )
void swap (QMqttTopicName & other )
bool operator!= (const QMqttTopicName & lhs , const QMqttTopicName & rhs )
bool operator< (const QMqttTopicName & lhs , const QMqttTopicName & rhs )
QDataStream & operator<< (QDataStream & out , const QMqttTopicName & name )
bool operator== (const QMqttTopicName & lhs , const QMqttTopicName & rhs )
QDataStream & operator>> (QDataStream & in , QMqttTopicName & name )

詳細描述

QMqttTopicName is a thin wrapper around a QString providing an expressive data type for MQTT topic names. Beside the benefits of having a strong type preventing unintended misuse, QMqttTopicName provides convenient functions related to topic names like isValid () 或 levels ().

另請參閱 QMqttTopicFilter .

成員函數文檔編製

QMqttTopicName:: QMqttTopicName (const QMqttTopicName & name )

Creates a new MQTT topic name as a copy of name .

QMqttTopicName:: QMqttTopicName (const QLatin1String & name )

Creates a new MQTT topic name with the specified name .

QMqttTopicName:: QMqttTopicName (const QString & name = QString())

Creates a new MQTT topic name with the specified name .

QMqttTopicName &QMqttTopicName:: operator= (const QMqttTopicName & name )

Assigns the MQTT topic name name to this object, and returns a reference to the copy.

QMqttTopicName:: ~QMqttTopicName ()

銷毀 QMqttTopicName 對象。

bool QMqttTopicName:: isValid () const

返迴 true if the topic name is valid according to the MQTT standard section 4.7, or false 否則。

int QMqttTopicName:: levelCount () const

Returns the total number of topic levels.

QStringList QMqttTopicName:: levels () const

Returns the topic levels.

QString QMqttTopicName:: name () const

Returns the topic name.

另請參閱 setName ().

void QMqttTopicName:: setName (const QString & name )

Sets the topic name to name .

另請參閱 name ().

void QMqttTopicName:: swap ( QMqttTopicName & other )

Swaps the MQTT topic name other with this MQTT topic name. This operation is very fast and never fails.

相關非成員

bool operator!= (const QMqttTopicName & lhs , const QMqttTopicName & rhs )

返迴 true if the topic names lhs and rhs 不同,否則返迴 false .

bool operator< (const QMqttTopicName & lhs , const QMqttTopicName & rhs )

返迴 true if the topic name lhs is lexically less than the topic name rhs ;否則返迴 false .

QDataStream & operator<< ( QDataStream & out , const QMqttTopicName & name )

Writes the topic name name 到流 out 並返迴流引用。

另請參閱 QDataStream 運算符格式 .

bool operator== (const QMqttTopicName & lhs , const QMqttTopicName & rhs )

返迴 true if the topic names lhs and rhs 相等,否則返迴 false .

QDataStream & operator>> ( QDataStream & in , QMqttTopicName & name )

Reads a topic name into name 從流 in 並返迴流引用。

另請參閱 QDataStream 運算符格式 .