本页内容

QDnsTextRecord Class

QDnsTextRecord 类用于存储有关 DNS TXT 记录的信息。更多内容...

头文件: #include <QDnsTextRecord>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network

公共函数

QDnsTextRecord()
QDnsTextRecord(const QDnsTextRecord &other)
~QDnsTextRecord()
QString name() const
void swap(QDnsTextRecord &other)
quint32 timeToLive() const
QList<QByteArray> values() const
QDnsTextRecord &operator=(const QDnsTextRecord &other)

详细说明

执行文本查询时,将返回零个或多个记录。每个记录由一个 QDnsTextRecord 实例表示。

这些字段的含义在RFC 1035 中进行了定义。

另请参阅 QDnsLookup 。

成员函数文档

QDnsTextRecord::QDnsTextRecord()

创建一个空的文本记录对象。

QDnsTextRecord::QDnsTextRecord(const QDnsTextRecord &other)

创建other 的副本。

[noexcept] QDnsTextRecord::~QDnsTextRecord()

删除一条文本记录。

QString QDnsTextRecord::name() const

返回此文本记录的名称。

[noexcept] void QDnsTextRecord::swap(QDnsTextRecord &other)

将此文本记录实例与other 进行交换。此操作速度极快,且绝不会失败。

quint32 QDnsTextRecord::timeToLive() const

返回该记录的有效时长(以秒为单位)。

QList<QByteArray> QDnsTextRecord::values() const

返回此文本记录的值。

QDnsTextRecord &QDnsTextRecord::operator=(const QDnsTextRecord &other)

将other 对象的数据赋值给此记录对象,并返回对其的引用。

© 2026 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.