esp8266ndn
NDN Arduino library for ESP8266 and more
|
Name component. More...
#include <component.hpp>
Inherits ndnph::Printable.
Public Member Functions | |
Component ()=default | |
Component (Region ®ion, uint16_t type, size_t length, const uint8_t *value) | |
Construct from T-L-V. More... | |
Component (Region ®ion, size_t length, const uint8_t *value) | |
Construct GenericNameComponent from L-V. More... | |
Component (uint8_t *buf, size_t bufLen, uint16_t type, size_t length, const uint8_t *value, bool writeFromBack=false) | |
Construct from T-L-V into provided buffer. More... | |
operator bool () const | |
Return true if Component is valid. More... | |
uint16_t | type () const |
size_t | length () const |
const uint8_t * | value () const |
const uint8_t * | tlv () const |
size_t | size () const |
void | encodeTo (Encoder &encoder) const |
bool | decodeFrom (const Decoder::Tlv &d) |
size_t | printTo (::Print &p) const final |
template<typename Convention > | |
bool | is () const |
template<typename Convention , typename... Arg> | |
auto | as (Arg &&... arg) const -> decltype(Convention::parse(*this, std::forward< Arg >(arg)...)) |
![]() | |
operator Esp32Printable () const | |
Static Public Member Functions | |
static Component | constant (const uint8_t *tlv, size_t size) |
Construct from const TLV buffer. More... | |
template<typename... Arg> | |
static Component | from (Region ®ion, uint16_t type, const Arg &... arg) |
Construct from TLV-TYPE, and several arguments to be encoded to TLV-VALUE. More... | |
static Component | parse (Region ®ion, const char *uri) |
Parse from URI. More... | |
static Component | parse (Region ®ion, const char *uri, size_t uriLen) |
static Component | parse (uint8_t *buf, size_t bufLen, const char *uri) |
Parse from URI into provided buffer. More... | |
static Component | parse (uint8_t *buf, size_t bufLen, const char *uri, size_t uriLen, bool writeFromBack=false) |
Name component.
This type is immutable, except `decodeFrom()` method.
|
explicitdefault |
|
inlineexplicit |
Construct from T-L-V.
|
inlineexplicit |
Construct GenericNameComponent from L-V.
|
inlineexplicit |
Construct from T-L-V into provided buffer.
buf | buffer for writing TLV. |
bufLen | size of buf; if insufficient, !component will be true. |
type | TLV-TYPE |
length | TLV-LENGTH |
value | TLV-VALUE, may overlap with buf |
writeFromBack | write TLV from back of provided buffer instead of from front. |
|
inline |
|
inlinestatic |
Construct from const TLV buffer.
|
inline |
|
inline |
|
inlinestatic |
Construct from TLV-TYPE, and several arguments to be encoded to TLV-VALUE.
Arg | any Encodable type. |
|
inline |
|
inline |
|
inlineexplicit |
Return true if Component is valid.
Parse from URI.
region | memory region; must have 8 + strlen(uri) available room. |
uri | URI in canonical format; except that `8=` prefix of GenericNameComponent may be omitted. |
|
inlinestatic |
|
inlinestatic |
Parse from URI into provided buffer.
|
inlinestatic |
|
inlinefinalvirtual |
Implements ndnph::Printable.
|
inline |
|
inline |
|
inline |
|
inline |