The QMqttTopicName class represents a MQTT topic name. 更多...
头: | #include <QMqttTopicName> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Mqtt)
target_link_libraries(mytarget PRIVATE Qt6::Mqtt) |
qmake: | QT += mqtt |
注意: 此类的所有函数 可重入 .
QMqttTopicName (const QString & name = QString()) | |
QMqttTopicName (const QLatin1String & name ) | |
QMqttTopicName (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 ) |
QMqttTopicName & | operator= (const QMqttTopicName & name ) |
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 .
Creates a new MQTT topic name with the specified name .
Creates a new MQTT topic name with the specified name .
Creates a new MQTT topic name as a copy of name .
[noexcept]
QMqttTopicName::
~QMqttTopicName
()
销毁 QMqttTopicName 对象。
返回
true
if the topic name is valid according to the MQTT standard section 4.7, or
false
否则。
Returns the total number of topic levels.
Returns the topic levels.
Returns the topic name.
另请参阅 setName ().
Sets the topic name to name .
另请参阅 name ().
[noexcept]
void
QMqttTopicName::
swap
(
QMqttTopicName
&
other
)
Swaps the MQTT topic name other with this MQTT topic name. This operation is very fast and never fails.
Assigns the MQTT topic name name to this object, and returns a reference to the copy.
[noexcept]
bool
operator!=
(const
QMqttTopicName
&
lhs
, const
QMqttTopicName
&
rhs
)
返回
true
if the topic names
lhs
and
rhs
不同,否则返回
false
.
[noexcept]
bool
operator<
(const
QMqttTopicName
&
lhs
, const
QMqttTopicName
&
rhs
)
返回
true
if the topic name
lhs
is lexically less than the topic name
rhs
;否则返回
false
.
Writes the topic name name 到流 out 并返回流引用。
另请参阅 QDataStream 运算符格式 .
[noexcept]
bool
operator==
(const
QMqttTopicName
&
lhs
, const
QMqttTopicName
&
rhs
)
返回
true
if the topic names
lhs
and
rhs
相等,否则返回
false
.
Reads a topic name into name 从流 in 并返回流引用。
另请参阅 QDataStream 运算符格式 .