QCoapResource Class
QCoapResource 클래스는 검색된 리소스에 대한 정보를 보유합니다. 더 보기...
헤더: | #include <QCoapResource> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Coap) target_link_libraries(mytarget PRIVATE Qt6::Coap) |
qmake: | QT += coap |
참고: 이 클래스의 모든 함수는 재진입합니다.
공용 함수
QCoapResource() | |
QCoapResource(const QCoapResource &other) | |
~QCoapResource() | |
uint | contentFormat() const |
QHostAddress | host() const |
QString | interface() const |
int | maximumSize() const |
bool | observable() const |
QString | path() const |
QString | resourceType() const |
void | setContentFormat(uint contentFormat) |
void | setHost(const QHostAddress &host) |
void | setInterface(const QString &interface) |
void | setMaximumSize(int maximumSize) |
void | setObservable(bool observable) |
void | setPath(const QString &path) |
void | setResourceType(const QString &resourceType) |
void | setTitle(const QString &title) |
void | swap(QCoapResource &other) |
QString | title() const |
QCoapResource & | operator=(const QCoapResource &other) |
자세한 설명
QCoapRequest 에는 리소스의 경로와 제목 및 기타 보조 정보로 데이터가 포함됩니다.
QCoapResourceDiscoveryReply도 참조하세요 .
멤버 함수 문서
QCoapResource::QCoapResource()
새 QCoapResource를 생성합니다.
QCoapResource::QCoapResource(const QCoapResource &other)
other 의 복사본으로 새 CoAP 리소스를 구성하여 두 리소스를 동일하게 만듭니다.
[noexcept]
QCoapResource::~QCoapResource()
QCoapResource 을 삭제합니다.
uint QCoapResource::contentFormat() const
리소스의 Content-Format 코드를 반환합니다.
Content-Format 코드는 'ct' 속성에 해당하며 이 리소스가 반환하는 Content-Formats에 대한 힌트를 제공합니다. RFC 7252에 지정되어 있습니다.
setContentFormat()도 참조하세요 .
QHostAddress QCoapResource::host() const
리소스의 호스트를 반환합니다.
setHost()도 참조하세요 .
QString QCoapResource::interface() const
리소스의 인터페이스 설명을 반환합니다.
인터페이스 설명 'if' 속성은 대상 리소스와 상호 작용하는 데 사용되는 특정 인터페이스 정의를 나타내는 이름 또는 URI를 제공하는 데 사용되는 불투명 문자열입니다. RFC 6690에 지정되어 있습니다.
setInterface()도 참조하세요 .
int QCoapResource::maximumSize() const
리소스의 최대 크기를 반환합니다.
최대 크기 추정 속성 'sz'는 대상 URI에서 GET을 수행하여 반환된 리소스 표현의 최대 크기를 나타냅니다. RFC 6690에 지정되어 있습니다.
setMaximumSize()도 참조하세요 .
bool QCoapResource::observable() const
리소스를 관찰할 수 있는 경우 true
를 반환합니다.
setObservable()도 참조하세요 .
QString QCoapResource::path() const
리소스의 경로를 반환합니다.
setPath()도 참조하세요 .
QString QCoapResource::resourceType() const
리소스 유형을 반환합니다.
setResourceType()도 참조하세요 .
void QCoapResource::setContentFormat(uint contentFormat)
리소스의 콘텐츠 형식을 contentFormat 로 설정합니다. 콘텐츠 형식은 CoAP 콘텐츠 형식 레지스트리에 정의된 콘텐츠 형식 중 하나 일 수 있습니다.
참고: CoAP는 XML, JSON 등과 같은 일반적인 콘텐츠 형식을 지원하지만 이러한 형식은 텍스트 기반이므로 페이로드와 처리량이 모두 무겁습니다. CoAP와 함께 사용하는 것이 권장되는 콘텐츠 형식 중 하나는 이러한 맥락에서 사용하도록 설계된 CBOR입니다.
contentFormat(), QCborStreamWriter, QCborStreamReader 를참조하세요 .
void QCoapResource::setHost(const QHostAddress &host)
리소스의 호스트를 host 로 설정합니다.
host()도 참조하세요 .
void QCoapResource::setInterface(const QString &interface)
리소스의 인터페이스를 interface 로 설정합니다.
interface()도 참조하세요 .
void QCoapResource::setMaximumSize(int maximumSize)
리소스의 최대 크기를 maximumSize 로 설정합니다.
maximumSize()도 참조하세요 .
void QCoapResource::setObservable(bool observable)
observable 매개 변수가 true
인 경우 리소스를 관찰 가능하게 만듭니다.
observable()도 참조하세요 .
void QCoapResource::setPath(const QString &path)
리소스 경로를 path 로 설정합니다.
path()도 참조하세요 .
void QCoapResource::setResourceType(const QString &resourceType)
리소스 유형을 resourceType 로 설정합니다.
resourceType()도 참조하세요 .
void QCoapResource::setTitle(const QString &title)
리소스 제목을 title 로 설정합니다.
title()도 참조하세요 .
[noexcept]
void QCoapResource::swap(QCoapResource &other)
이 리소스를 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.
QString QCoapResource::title() const
리소스의 제목을 반환합니다.
setTitle()도 참조하세요 .
QCoapResource &QCoapResource::operator=(const QCoapResource &other)
other 을 이 리소스에 복사하여 두 리소스를 동일하게 만듭니다. 이에 대한 참조를 반환합니다 QCoapResource.
© 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.