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는 메시지에 포함될 수 있는 여러 옵션을 정의합니다. 요청과 응답 모두 하나 이상의 옵션 목록을 포함할 수 있습니다. 예를 들어, 요청의 URI는 여러 옵션으로 전송되며, HTTP에서 HTTP 헤더로 전달되는 메타데이터도 옵션으로 제공됩니다.

옵션에는 옵션 ID와 관련된 이름과 값이 포함됩니다. 이름은 OptionName 열거형의 값 중 하나입니다.

멤버 유형 문서

enum QCoapOption::OptionName

옵션의 이름을 나타냅니다. 각 ID의 값은 유효하지 않음을 제외하고 CoAP 표준에서 지정한 대로입니다. 자세한 내용은 RFC 7252RFC 7959를 참조하세요.

상수설명
QCoapOption::Invalid0유효하지 않은 옵션입니다.
QCoapOption::IfMatch1If-Match 옵션.
QCoapOption::UriHost3Uri-Host 옵션.
QCoapOption::Etag4Etag 옵션.
QCoapOption::IfNoneMatch5일치하지 않음 옵션.
QCoapOption::Observe6관찰 옵션.
QCoapOption::UriPort7Uri-Port 옵션.
QCoapOption::LocationPath8위치 경로 옵션.
QCoapOption::UriPath11Uri-Path 옵션.
QCoapOption::ContentFormat12콘텐츠 형식 옵션.
QCoapOption::MaxAge14최대 연령 옵션.
QCoapOption::UriQuery15Uri-Query 옵션.
QCoapOption::Accept17수락 옵션.
QCoapOption::LocationQuery20위치 쿼리 옵션.
QCoapOption::Block223블록2 옵션.
QCoapOption::Block127블록1 옵션.
QCoapOption::Size228Size2 옵션.
QCoapOption::ProxyUri35프록시-Uri 옵션.
QCoapOption::ProxyScheme39프록시-스킴 옵션.
QCoapOption::Size160Size1 옵션.

멤버 함수 문서

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

주어진 nameQByteArray opaqueValue 를 사용하여 새 CoAP 옵션을 구축합니다. 매개변수가 전달되지 않으면 유효하지 않은 객체를 구축합니다.

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)

other 의 복사본으로 새 CoAP 옵션을 구성하여 두 옵션을 동일하게 만듭니다.

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 을 이 옵션에 복사하여 두 옵션을 동일하게 만듭니다. 이에 대한 참조를 반환합니다 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.