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. More... | |
Encoder (Region ®ion) | |
Create over remaining space in a Region. More... | |
![]() | |
Encoder (uint8_t *buf, size_t capacity) | |
Create over given buffer. More... | |
Encoder (Region ®ion) | |
Create over remaining space in a Region. More... | |
operator bool () const | |
Return true if no errors were encountered, such as running out of space. More... | |
const uint8_t * | begin () const |
Get output begin. More... | |
const uint8_t * | end () const |
Get output end. More... | |
size_t | size () const |
Get output size. More... | |
size_t | availableHeadroom () const |
Get available headroom. More... | |
void | trim () const |
Release unused space to the Region. More... | |
void | discard () |
Release all space to the Region. More... | |
void | resetFront (uint8_t *pos) |
Reset front to given position. More... | |
uint8_t * | prependRoom (size_t size) |
Make room to prepend an object. More... | |
bool | prependTypeLength (uint32_t type, size_t length) |
Prepend TLV-TYPE and TLV-LENGTH. More... | |
template<typename First , typename... Arg> | |
bool | prepend (const First &first, const Arg &... arg) |
Prepend a sequence of values. More... | |
template<typename... Arg> | |
bool | prependTlv (uint32_t type, OmitEmptyTag omitEmpty, const Arg &... arg) |
Prepend TLV, measuring TLV-LENGTH automatically. More... | |
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. More... | |
bool | prependTlv (uint32_t type) |
Prepend TLV with zero TLV-LENGTH. More... | |
void | setError () |
Indicate an error has occurred. More... | |
Additional Inherited Members | |
![]() | |
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.