A class that encodes CBOR data types that includes: unsigned integers, negative integers, byte strings, text strings encoded as UTF8, simple values and float-point number.
More...
#include <cbor/Encoder.hpp>
A class that encodes CBOR data types that includes: unsigned integers, negative integers, byte strings, text strings encoded as UTF8, simple values and float-point number.
◆ Encoder()
An Encoder Constructor that sets an output stream.
- Parameters
-
◆ operator<<() [1/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
bool |
value | ) |
-> Encoder & |
Encodes bool value.
- Parameters
-
- Returns
- A reference to this object
◆ operator<<() [2/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
BreakTag |
tag | ) |
-> Encoder & |
Encodes a CBOR break value (simple value 31)
- Parameters
-
tag | Always pass kBreak as this parameter |
- Returns
- A reference to this object
- See also
- section 3.2.1) RFC 8949.
◆ operator<<() [3/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
const Array & |
array | ) |
-> Encoder & |
Encodes the header of a CBOR array.
This function only encodes the header of the array, consisting of the major type and the length. The array elements and (for indefinite length arrays) the stop code must be encoded separately.
- Parameters
-
array | The array header to encode |
- Returns
- A reference to this object
◆ operator<<() [4/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
const Data & |
data | ) |
-> Encoder & |
Encodes byte string of opaque bytes.
- Parameters
-
data | The data block to encode |
- Returns
- A reference to this object
◆ operator<<() [5/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
const Map & |
map | ) |
-> Encoder & |
Encodes the header of a CBOR array.
This function only encodes the header of the map, consisting of the major type and the length. The keys and values and (for indefinite length maps) the stop code must be encoded separately.
- Parameters
-
map | The map header to encode |
- Returns
- A reference to this object
◆ operator<<() [6/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
const String & |
string | ) |
-> Encoder & |
Encodes text string of unicode characters that is encoded as UTF-8.
- Parameters
-
- Returns
- A reference to this object
◆ operator<<() [7/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
double |
value | ) |
-> Encoder & |
Encodes double value.
- Parameters
-
- Returns
- A reference to this object
◆ operator<<() [8/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
float |
value | ) |
-> Encoder & |
Encodes float value.
- Parameters
-
- Returns
- A reference to this object
◆ operator<<() [9/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
NullTag |
tag | ) |
-> Encoder & |
Encodes a CBOR null value (simple value 22)
- Parameters
-
tag | Always pass kNull as this parameter |
- Returns
- A reference to this object
◆ operator<<() [10/14]
Encodes an arbitrary CBOR simple value.
- Parameters
-
- Returns
- A reference to this object
◆ operator<<() [11/14]
auto xentara::utils::cbor::Encoder::operator<< |
( |
Tag |
value | ) |
-> Encoder & |
Encodes a CBOR data item tag.
- Parameters
-
- Returns
- A reference to this object
- See also
- section 3.4) of RFC 8949.
◆ operator<<() [12/14]
template<tools::UnsignedIntegral Type>
auto xentara::utils::cbor::Encoder::operator<< |
( |
Type |
value | ) |
-> Encoder & |
Enocdes a unsigned integeral value.
- Parameters
-
- Returns
- A reference to this object
◆ operator<<() [13/14]
template<tools::SignedIntegral Type>
auto xentara::utils::cbor::Encoder::operator<< |
( |
Type |
value | ) |
-> Encoder & |
Encodes signed/unsigned integeral value.
- Parameters
-
- Returns
- A reference to this object
◆ operator<<() [14/14]
Encodes a CBOR undefined value (simple value 23)
- Parameters
-
- Returns
- A reference to this object
- See also
- section 5.7) of RFC 8949.