esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
ndnph::tlv::Value Class Reference

A sequence of bytes, usually TLV-VALUE. More...

#include <value.hpp>

Public Member Functions

 Value ()=default
 
 Value (const uint8_t *value, size_t size)
 Reference a byte range. More...
 
 Value (const uint8_t *first, const uint8_t *last)
 Reference a byte range. More...
 
 Value (const Encoder &encoder)
 Reference encoder output. More...
 
 operator bool () const
 Return true if value is non-empty. More...
 
const uint8_t * begin () const
 
const uint8_t * end () const
 
size_t size () const
 
void encodeTo (Encoder &encoder) const
 
bool decodeFrom (const Decoder::Tlv &d)
 
Decoder makeDecoder () const
 Create a Decoder over this value buffer. More...
 
Value clone (Region &region) const
 Clone buffer into given region. More...
 

Static Public Member Functions

static Value fromString (const char *str)
 

Detailed Description

A sequence of bytes, usually TLV-VALUE.

Constructor & Destructor Documentation

◆ Value() [1/4]

ndnph::tlv::Value::Value ( )
explicitdefault

◆ Value() [2/4]

ndnph::tlv::Value::Value ( const uint8_t *  value,
size_t  size 
)
inlineexplicit

Reference a byte range.

◆ Value() [3/4]

ndnph::tlv::Value::Value ( const uint8_t *  first,
const uint8_t *  last 
)
inlineexplicit

Reference a byte range.

◆ Value() [4/4]

ndnph::tlv::Value::Value ( const Encoder encoder)
inlineexplicit

Reference encoder output.

Member Function Documentation

◆ begin()

const uint8_t* ndnph::tlv::Value::begin ( ) const
inline

◆ clone()

Value ndnph::tlv::Value::clone ( Region region) const
inline

Clone buffer into given region.

Returns
new Value that does not reference memory of this Value, or empty Value if allocation fails.

◆ decodeFrom()

bool ndnph::tlv::Value::decodeFrom ( const Decoder::Tlv d)
inline

◆ encodeTo()

void ndnph::tlv::Value::encodeTo ( Encoder encoder) const
inline

◆ end()

const uint8_t* ndnph::tlv::Value::end ( ) const
inline

◆ fromString()

static Value ndnph::tlv::Value::fromString ( const char *  str)
inlinestatic

◆ makeDecoder()

Decoder ndnph::tlv::Value::makeDecoder ( ) const
inline

Create a Decoder over this value buffer.

◆ operator bool()

ndnph::tlv::Value::operator bool ( ) const
inlineexplicit

Return true if value is non-empty.

◆ size()

size_t ndnph::tlv::Value::size ( ) const
inline

The documentation for this class was generated from the following file: