A class that decodes CBOR data types that includes: unsigned integers, negative integers, byte strings, text strings encoded as UTF-8, simple values and float-point number.
More...
#include <cbor/Decoder.hpp>
A class that decodes CBOR data types that includes: unsigned integers, negative integers, byte strings, text strings encoded as UTF-8, simple values and float-point number.
◆ Decoder()
A Decoder constructor that sets an input stream.
- Parameters
-
◆ operator>>() [1/16]
auto xentara::utils::cbor::Decoder::operator>> |
( |
Array & |
array | ) |
-> Decoder & |
Decodes the header of a CBOR array.
This function only decodes 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 decoded separately.
- Parameters
-
array | The array header to decode |
- Returns
- A reference to this object
◆ operator>>() [2/16]
auto xentara::utils::cbor::Decoder::operator>> |
( |
bool & |
value | ) |
-> Decoder & |
Decodes bool value.
- Parameters
-
- Returns
- A reference to this object
◆ operator>>() [3/16]
auto xentara::utils::cbor::Decoder::operator>> |
( |
BreakTag |
tag | ) |
-> Decoder & |
Decodes 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>>() [4/16]
template<typename Allocator >
Decodes byte string of opaque bytes.
- Parameters
-
- Returns
- A reference to this object
◆ operator>>() [5/16]
auto xentara::utils::cbor::Decoder::operator>> |
( |
DataType & |
value | ) |
-> Decoder & |
Checks what the data type of the next value will be.
This function does not consume any data in the stream, it only looks ahead to what the next value will be without actually reading it. The actual value concerned can be extracted as usual after determining the data type.
- Returns
- The data type of the next value in the stream
◆ operator>>() [6/16]
auto xentara::utils::cbor::Decoder::operator>> |
( |
double & |
value | ) |
-> Decoder & |
Decodes double value.
- Parameters
-
- Returns
- A reference to this object
◆ operator>>() [7/16]
Checks what the data type and bit size of the next value will be.
This function does not consume any data in the stream, it only looks ahead to what the next value will be without actually reading it. The actual value concerned can be extracted as usual after determining the data type.
- Returns
- The data type of the next value in the stream
◆ operator>>() [8/16]
auto xentara::utils::cbor::Decoder::operator>> |
( |
float & |
value | ) |
-> Decoder & |
Decodes float value.
- Parameters
-
- Returns
- A reference to this object
◆ operator>>() [9/16]
auto xentara::utils::cbor::Decoder::operator>> |
( |
Map & |
map | ) |
-> Decoder & |
Decodes the header of a CBOR map.
This function only decodes 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 decoded separately.
- Parameters
-
map | The map header to decode |
- Returns
- A reference to this object
◆ operator>>() [10/16]
auto xentara::utils::cbor::Decoder::operator>> |
( |
NullTag |
tag | ) |
-> Decoder & |
Decodes a CBOR null value (simple value 22)
- Parameters
-
tag | Always pass kNull as this parameter |
- Returns
- A reference to this object
◆ operator>>() [11/16]
Decodes an arbitrary CBOR simple value.
- Parameters
-
- Returns
- A reference to this object
◆ operator>>() [12/16]
template<typename CharTraits , typename Allocator >
auto xentara::utils::cbor::Decoder::operator>> |
( |
std::basic_string< char, CharTraits, Allocator > & |
string | ) |
-> Decoder & |
Decodes text string of Unicode characters that is encoded as UTF-8 - Major Type 3.
- Parameters
-
string | Address of the data |
- Returns
- A reference to this object
◆ operator>>() [13/16]
auto xentara::utils::cbor::Decoder::operator>> |
( |
Tag & |
value | ) |
-> Decoder & |
Decodes a CBOR data item tag.
- Parameters
-
- Returns
- A reference to this object
- See also
- section 3.4) of RFC 8949.
◆ operator>>() [14/16]
template<tools::UnsignedIntegral Type>
auto xentara::utils::cbor::Decoder::operator>> |
( |
Type & |
value | ) |
-> Decoder & |
Decodes an unsigned integeral value.
- Parameters
-
- Returns
- A reference to this object
◆ operator>>() [15/16]
template<tools::SignedIntegral Type>
auto xentara::utils::cbor::Decoder::operator>> |
( |
Type & |
value | ) |
-> Decoder & |
Decodes signed/unsigned integeral value.
- Parameters
-
- Returns
- A reference to this object
◆ operator>>() [16/16]
Decodes a CBOR undefined value (simple value 23)
- Parameters
-
- Returns
- A reference to this object
- See also
- section 5.7) of RFC 8949.