|
CeresEngine 0.2.0
A game development framework
|
The Decoder class is a CBOR (Concise Binary Object Representation) decoder that provides an abstraction for deserializing CBOR data from an input stream.
More...
#include <CeresEngine/Foundation/CBOR.hpp>
Public Member Functions | |
| Decoder (InputStream inputStream) | |
Creates a new CBOR decoder from an InputStream. | |
| Decoder (IInputStream &inputStream) | |
Creates a new CBOR decoder from an IInputStream. | |
| Value | read () |
| Decodes the next object from the CBOR stream. | |
| template<typename Callback > | |
| void | map (const Value &value, Callback &&callback) |
| Decodes the contents of a map from the CBOR value stream. | |
| Generator< Pair< Value, Value > > | map (const Map &value) |
| Decodes the contents of a map from the CBOR value stream. | |
| template<typename Callback > | |
| void | array (const Value &value, Callback &&callback) |
| Decodes the contents of an array from the CBOR value stream. | |
| Generator< Value > | array (const Array &value) |
| Decodes the contents of an array from the CBOR value stream. | |
| template<typename Callback > | |
| void | tag (const Value &value, Callback &&callback) |
| Decodes the contents of a tag from the CBOR value stream. | |
Private Attributes | |
| BufferedInputStream | mStream |
| The stream to read from. | |
The Decoder class is a CBOR (Concise Binary Object Representation) decoder that provides an abstraction for deserializing CBOR data from an input stream.
It's designed to decode CBOR values from an instance of an InputStream. It provides an efficient and convenient way to read and decode CBOR data streams, without having to parse the entire data stream into memory.
|
inlineexplicit |
Creates a new CBOR decoder from an InputStream.
|
inlineexplicit |
Creates a new CBOR decoder from an IInputStream.
| Value CeresEngine::CBOR::Decoder::read | ( | ) |
|
private |
The stream to read from.
This is a buffered InputStream and it's very important that this is referenced by value (not through the InputStream wrapper), as it allows to reduce the number of virtual calls and significantly increase the performance.