#include <Cbor.h>
Aws::Crt::Cbor::CborEncoder::CborEncoder |
( |
const CborEncoder & |
| ) |
|
|
delete |
Aws::Crt::Cbor::CborEncoder::CborEncoder |
( |
CborEncoder && |
| ) |
|
|
delete |
Aws::Crt::Cbor::CborEncoder::~CborEncoder |
( |
| ) |
|
|
noexcept |
ByteCursor Aws::Crt::Cbor::CborEncoder::GetEncodedData |
( |
| ) |
|
|
noexcept |
Get the current encoded data from encoder. The encoded data has the same lifetime as the encoder, and once any other function call invoked for the encoder, the encoded data is no longer valid.
- Returns
- the current encoded data
void Aws::Crt::Cbor::CborEncoder::Reset |
( |
| ) |
|
|
noexcept |
Clear the current encoded buffer from encoder.
void Aws::Crt::Cbor::CborEncoder::WriteArrayStart |
( |
size_t |
number_entries | ) |
|
|
noexcept |
Encode an ArrayStart value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1 Notes: it's user's responsibility to keep the integrity of the array to be encoded.
- Parameters
-
number_entries | the number of CBOR data items to be followed as the content of the array. |
void Aws::Crt::Cbor::CborEncoder::WriteBool |
( |
bool |
value | ) |
|
|
noexcept |
Encode a simple value Bool
void Aws::Crt::Cbor::CborEncoder::WriteBreak |
( |
| ) |
|
|
noexcept |
Encode a simple value Break Notes: no error checking, it's user's responsibility to track the break to close the corresponding indef_start
void Aws::Crt::Cbor::CborEncoder::WriteBytes |
( |
ByteCursor |
value | ) |
|
|
noexcept |
Encode a Bytes value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1, the length of "value" will be encoded first and then the value of "value" will be followed.
- Parameters
-
void Aws::Crt::Cbor::CborEncoder::WriteFloat |
( |
double |
value | ) |
|
|
noexcept |
Encode a AWS_CBOR_TYPE_FLOAT value to "smallest possible", but will not be encoded into half-precision float, as it's not well supported cross languages.
To be more specific, it will be encoded into integer/negative/float (Order with priority) when the conversion will not cause precision loss.
- Parameters
-
void Aws::Crt::Cbor::CborEncoder::WriteIndefArrayStart |
( |
| ) |
|
|
noexcept |
Encode an IndefArrayStart Notes: no error checking, it's user's responsibility to add corresponding data and the break to close the indef_start
void Aws::Crt::Cbor::CborEncoder::WriteIndefBytesStart |
( |
| ) |
|
|
noexcept |
Encode an IndefBytesStart Notes: no error checking, it's user's responsibility to add corresponding data and the break to close the indef_start
void Aws::Crt::Cbor::CborEncoder::WriteIndefMapStart |
( |
| ) |
|
|
noexcept |
Encode an IndefMapStart Notes: no error checking, it's user's responsibility to add corresponding data and the break to close the indef_start
void Aws::Crt::Cbor::CborEncoder::WriteIndefTextStart |
( |
| ) |
|
|
noexcept |
Encode an IndefTextStart Notes: no error checking, it's user's responsibility to add corresponding data and the break to close the indef_start
void Aws::Crt::Cbor::CborEncoder::WriteMapStart |
( |
size_t |
number_entries | ) |
|
|
noexcept |
Encode a MapStart value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1
Notes: it's user's responsibility to keep the integrity of the map to be encoded.
- Parameters
-
number_entries | the number of pair of CBOR data items as key and value to be followed as the content of the map. |
void Aws::Crt::Cbor::CborEncoder::WriteNegInt |
( |
uint64_t |
value | ) |
|
|
noexcept |
Encode a AWS_CBOR_TYPE_NEGINT value to "smallest possible" in encoder's buffer. It represents (-1 - value). Referring to RFC8949 section 4.2.1
- Parameters
-
value | value to encode, which is (-1 - represented value) |
void Aws::Crt::Cbor::CborEncoder::WriteNull |
( |
| ) |
|
|
noexcept |
Encode a simple value Null
void Aws::Crt::Cbor::CborEncoder::WriteTag |
( |
uint64_t |
tag_number | ) |
|
|
noexcept |
Encode a Tag value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1 The following CBOR data item will be the content of the tagged value. Notes: it's user's responsibility to keep the integrity of the tagged value to follow the RFC8949 section 3.4
- Parameters
-
tag_number | The tag value to encode. |
void Aws::Crt::Cbor::CborEncoder::WriteText |
( |
ByteCursor |
value | ) |
|
|
noexcept |
Encode a Text value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1, the length of "value" will be encoded first and then the value of "value" will be followed.
- Parameters
-
void Aws::Crt::Cbor::CborEncoder::WriteUInt |
( |
uint64_t |
value | ) |
|
|
noexcept |
Encode a AWS_CBOR_TYPE_UINT value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1
- Parameters
-
void Aws::Crt::Cbor::CborEncoder::WriteUndefined |
( |
| ) |
|
|
noexcept |
Encode a simple value Undefined
The documentation for this class was generated from the following files: