|
esp8266ndn
NDN Arduino library for ESP8266 and more
|
Encoder that auto-discards upon destruction. More...
#include <encoder.hpp>
Inherits ndnph::Encoder.
Public Member Functions | |
| ~ScopedEncoder () | |
| Encoder (uint8_t *buf, size_t capacity) | |
| Create over given buffer. | |
| Encoder (Region ®ion) | |
| Create over remaining space in a Region. | |
Public Member Functions inherited from ndnph::Encoder | |
| Encoder (uint8_t *buf, size_t capacity) | |
| Create over given buffer. | |
| Encoder (Region ®ion) | |
| Create over remaining space in a Region. | |
| operator bool () const | |
| Return true if no errors were encountered, such as running out of space. | |
| const uint8_t * | begin () const |
| Get output begin. | |
| const uint8_t * | end () const |
| Get output end. | |
| size_t | size () const |
| Get output size. | |
| size_t | availableHeadroom () const |
| Get available headroom. | |
| void | trim () const |
| Release unused space to the Region. | |
| void | discard () |
| Release all space to the Region. | |
| void | resetFront (uint8_t *pos) |
| Reset front to given position. | |
| uint8_t * | prependRoom (size_t size) |
| Make room to prepend an object. | |
| bool | prependTypeLength (uint32_t type, size_t length) |
| Prepend TLV-TYPE and TLV-LENGTH. | |
| template<typename First , typename... Arg> | |
| bool | prepend (const First &first, const Arg &... arg) |
| Prepend a sequence of values. | |
| template<typename... Arg> | |
| bool | prependTlv (uint32_t type, OmitEmptyTag omitEmpty, const Arg &... arg) |
| Prepend TLV, measuring TLV-LENGTH automatically. | |
| template<typename First , typename... Arg> | |
| std::enable_if<!std::is_same< First, OmitEmptyTag >::value, bool >::type | prependTlv (uint32_t type, const First &first, const Arg &... arg) |
| Prepend TLV, measuring TLV-LENGTH automatically. | |
| bool | prependTlv (uint32_t type) |
| Prepend TLV with zero TLV-LENGTH. | |
| void | setError () |
| Indicate an error has occurred. | |
Additional Inherited Members | |
Public Types inherited from ndnph::Encoder | |
| enum | OmitEmptyTag { NoOmitEmpty = 0 , OmitEmpty = 1 } |
Encoder that auto-discards upon destruction.
|
inline |
|
inlineexplicit |
Create over remaining space in a Region.
After encoding, unused space can be released with trim().
|
inlineexplicit |
Create over given buffer.