QCoapOption 類保持有關 CoAP 選項的數據。 更多...
| 頭: | #include <QCoapOption> |
| qmake: | QT += coap |
注意: 此類的所有函數 可重入 .
| enum | OptionName { Invalid, IfMatch, UriHost, Etag, IfNoneMatch, …, Size1 } |
| QCoapOption (QCoapOption && other ) | |
| QCoapOption (const QCoapOption & other ) | |
| QCoapOption (QCoapOption::OptionName name , quint32 intValue ) | |
| QCoapOption (QCoapOption::OptionName name , const QString & stringValue ) | |
| QCoapOption (QCoapOption::OptionName name = Invalid, const QByteArray & opaqueValue = QByteArray()) | |
| QCoapOption & | operator= (QCoapOption && other ) |
| QCoapOption & | operator= (const 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 |
| bool | operator== (const QCoapOption & other ) const |
CoAP defines a number of options that can be included in a message. Both requests and responses may include a list of one or more options. For example, the URI in a request is transported in several options, and metadata that would be carried in an HTTP header in HTTP is supplied as options as well.
An option contains a name, related to an option ID, and a value. The name is one of the values from the OptionName 枚舉。
Indicates the name of an option. The value of each ID is as specified by the CoAP standard, with the exception of Invalid. You can refer to RFC 7252 and RFC 7959 瞭解更多細節。
| 常量 | 值 | 描述 |
|---|---|---|
QCoapOption::Invalid
|
0
|
無效選項。 |
QCoapOption::IfMatch
|
1
|
If-Match option. |
QCoapOption::UriHost
|
3
|
Uri-Host option. |
QCoapOption::Etag
|
4
|
Etag option. |
QCoapOption::IfNoneMatch
|
5
|
If-None-Match option. |
QCoapOption::Observe
|
6
|
Observe option. |
QCoapOption::UriPort
|
7
|
Uri-Port option. |
QCoapOption::LocationPath
|
8
|
Location-path option. |
QCoapOption::UriPath
|
11
|
Uri-Path option. |
QCoapOption::ContentFormat
|
12
|
Content-Format option. |
QCoapOption::MaxAge
|
14
|
Max-Age option. |
QCoapOption::UriQuery
|
15
|
Uri-Query option. |
QCoapOption::Accept
|
17
|
Accept option. |
QCoapOption::LocationQuery
|
20
|
Location-Query option. |
QCoapOption::Block2
|
23
|
Block2 option. |
QCoapOption::Block1
|
27
|
Block1 option. |
QCoapOption::Size2
|
28
|
Size2 option. |
QCoapOption::ProxyUri
|
35
|
Proxy-Uri option. |
QCoapOption::ProxyScheme
|
39
|
Proxy-Scheme option. |
QCoapOption::Size1
|
60
|
Size1 option. |
Move-constructs a QCoapOption, making it point to the same object as other 所指嚮的。
Constructs a new CoAP option as a copy of other , making the two options identical.
另請參閱 isValid ().
Constructs a new CoAP option with the given name and the unsigned integer intValue .
另請參閱 isValid ().
Constructs a new CoAP option with the given name 和 QString stringValue .
另請參閱 isValid ().
Constructs a new CoAP option with the given name and QByteArray opaqueValue . If no parameters are passed, constructs an Invalid object.
另請參閱 isValid ().
移動賦值運算符。
拷貝 other into this option, making the two options identical. Returns a reference to this QCoapOption .
銷毀 QCoapOption 對象。
返迴
true
if the option is valid.
Returns the length of the value of the option.
Returns the name of the option.
Returns the value of the option.
返迴 QString value of the option.
Swaps this option with other 。此操作很快且從不失敗。
Returns the integer value of the option.
返迴
true
若此
QCoapOption
and
other
are different.
返迴
true
若此
QCoapOption
and
other
are equals.