QCoapOption Class

QCoapOptionクラスは、CoAPオプションに関するデータを保持します。詳細...

ヘッダー #include <QCoapOption>
CMake: find_package(Qt6 REQUIRED COMPONENTS Coap)
target_link_libraries(mytarget PRIVATE Qt6::Coap)
qmake: QT += coap

注意:このクラスの関数はすべてリエントラントです。

パブリック型

enum OptionName { Invalid, IfMatch, UriHost, Etag, IfNoneMatch, …, Size1 }

パブリック関数

QCoapOption(QCoapOption::OptionName name = Invalid, const QByteArray &opaqueValue = QByteArray())
QCoapOption(QCoapOption::OptionName name, const QString &stringValue)
QCoapOption(QCoapOption::OptionName name, quint32 intValue)
QCoapOption(const QCoapOption &other)
QCoapOption(QCoapOption &&other)
~QCoapOption()
bool isValid() const
int length() const
QCoapOption::OptionName name() const
QByteArray opaqueValue() const
QString stringValue() const
void swap(QCoapOption &other)
quint32 uintValue() const
bool operator!=(const QCoapOption &other) const
QCoapOption &operator=(QCoapOption &&other)
QCoapOption &operator=(const QCoapOption &other)
bool operator==(const QCoapOption &other) const

詳しい説明

CoAP は、メッセージに含めることができるいくつかのオプションを定義している。リクエストもレスポンスも、1つ以上のオプションのリストを含むことができる。たとえば、リクエストの URI はいくつかのオプションで伝送され、HTTP の HTTP ヘッダーで伝送されるメタデータもオプションとして供給されます。

オプションは、オプションIDに関連する名前と値を含む。名前はOptionName 列挙からの値のひとつです。

メンバ型ドキュメント

enum QCoapOption::OptionName

オプション名を示す。各 ID の値は、Invalid を除いて CoAP 標準で規定されている通りである。詳細はRFC 7252RFC 7959を参照してください。

定数説明
QCoapOption::Invalid0無効なオプション。
QCoapOption::IfMatch1If-Match オプション。
QCoapOption::UriHost3Uri-Host オプション。
QCoapOption::Etag4Etag オプション。
QCoapOption::IfNoneMatch5If-None-Match オプション
QCoapOption::Observe6Observe オプション
QCoapOption::UriPort7Uri-Portオプション
QCoapOption::LocationPath8Location-pathオプション
QCoapOption::UriPath11Uri-Path オプション
QCoapOption::ContentFormat12Content-Format オプション
QCoapOption::MaxAge14Max-Ageオプション
QCoapOption::UriQuery15Uri-Queryオプション
QCoapOption::Accept17Acceptオプション
QCoapOption::LocationQuery20Location-Queryオプション
QCoapOption::Block223Block2オプション
QCoapOption::Block127Block1オプション
QCoapOption::Size228Size2オプション
QCoapOption::ProxyUri35Proxy-Uriオプション
QCoapOption::ProxyScheme39Proxy-Schemeオプション
QCoapOption::Size160Size1オプション

メンバ関数ドキュメント

QCoapOption::QCoapOption(QCoapOption::OptionName name = Invalid, const QByteArray &opaqueValue = QByteArray())

与えられたnameQByteArray opaqueValue で新しい CoAP オプションを構築する。パラメータが渡されない場合、Invalid オブジェクトを構築します。

isValid()も参照してください

QCoapOption::QCoapOption(QCoapOption::OptionName name, const QString &stringValue)

与えられたnameQString stringValue で新しい CoAP オプションを構築する。

isValid()も参照

QCoapOption::QCoapOption(QCoapOption::OptionName name, quint32 intValue)

与えられたname と符号なし整数intValue で新しい CoAP オプションを構築する。

isValid()も参照

QCoapOption::QCoapOption(const QCoapOption &other)

新しい CoAP オプションをother のコピーとして構築する。

isValid()も参照してください

QCoapOption::QCoapOption(QCoapOption &&other)

Move-QCoapOptionを構築し、other が指していたのと同じオブジェクトを指すようにする。

[noexcept] QCoapOption::~QCoapOption()

QCoapOption オブジェクトを破棄する。

bool QCoapOption::isValid() const

オプションが有効ならtrue を返す。

int QCoapOption::length() const

オプションの値の長さを返します。

QCoapOption::OptionName QCoapOption::name() const

オプションの名前を返します。

QByteArray QCoapOption::opaqueValue() const

オプションの値を返します。

QString QCoapOption::stringValue() const

オプションのQString 値を返す。

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

このオプションをother と入れ替える。この操作は非常に速く、失敗することはない。

quint32 QCoapOption::uintValue() const

オプションの整数値を返します。

bool QCoapOption::operator!=(const QCoapOption &other) const

QCoapOptionother が異なる場合はtrue を返す。

[noexcept] QCoapOption &QCoapOption::operator=(QCoapOption &&other)

other をこのオプションに移動し、このQCoapOption への参照を返す。

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

other をこのオプションにコピーし、2つのオプションを同一にする。このQCoapOption への参照を返す。

bool QCoapOption::operator==(const QCoapOption &other) const

QCoapOptionother が等しい場合、true を返す。

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