59 if (varNumber < 253) {
62 else if (varNumber <= std::numeric_limits<uint16_t>::max()) {
65 else if (varNumber <= std::numeric_limits<uint32_t>::max()) {
83 if (varNumber <= std::numeric_limits<uint8_t>::max()) {
86 else if (varNumber <= std::numeric_limits<uint16_t>::max()) {
89 else if (varNumber <= std::numeric_limits<uint32_t>::max()) {
107 size_t totalLength = arraySize;
Copyright (c) 2011-2015 Regents of the University of California.
size_t prependByte(uint8_t value)
Prepend a byte.
size_t prependByteArrayBlock(uint32_t type, const uint8_t *array, size_t arraySize)
Prepend TLV block of type type and value from buffer array of size arraySize.
Represents a TLV element of NDN packet format.
size_t appendByteArray(const uint8_t *array, size_t length)
Append a byte array array of length length.
size_t prependByteArray(const uint8_t *array, size_t length)
Prepend a byte array array of length length.
size_t size() const
Get size of encoded wire, including Type-Length-Value.
size_t appendByteArrayBlock(uint32_t type, const uint8_t *array, size_t arraySize)
Append TLV block of type type and value from buffer array of size arraySize.
size_t prependVarNumber(uint64_t varNumber)
Prepend VarNumber varNumber of NDN TLV encoding.
size_t appendNonNegativeInteger(uint64_t integer)
Append non-negative integer integer of NDN TLV encoding.
Estimator(size_t totalReserve=0, size_t reserveFromBack=0)
Create instance of the estimator.
size_t prependBlock(const Block &block)
Prepend TLV block block.
size_t appendBlock(const Block &block)
Append TLV block block.
size_t value_size() const
Get size of TLV-VALUE aka TLV-LENGTH.
uint32_t type() const
Get TLV-TYPE.
size_t appendByte(uint8_t value)
Append a byte.
size_t appendVarNumber(uint64_t varNumber)
Prepend VarNumber varNumber of NDN TLV encoding.
bool hasWire() const
Check if the Block has fully encoded wire.
const uint8_t * value() const
Get pointer to TLV-VALUE.
size_t prependNonNegativeInteger(uint64_t integer)
Prepend non-negative integer integer of NDN TLV encoding.