22 #ifndef NDN_CXX_ENCODING_ESTIMATOR_HPP
23 #define NDN_CXX_ENCODING_ESTIMATOR_HPP
62 [[deprecated(
"use prependBytes()")]]
73 [[deprecated(
"use appendBytes()")]]
84 [[deprecated(
"use prependBytes()")]]
95 [[deprecated(
"use appendBytes()")]]
105 template<
class Iterator>
109 return std::distance(first, last);
115 template<
class Iterator>
119 return std::distance(first, last);
162 [[deprecated(
"use encoding::prependBinaryBlock()")]]
184 [[deprecated(
"use encoding::prependBlock()")]]
Represents a TLV element of the NDN packet format.
Helper class to estimate size of TLV encoding.
size_t appendBlock(const Block &block) const
Append TLV block block.
constexpr size_t prependBytes(span< const uint8_t > bytes) const noexcept
Prepend a sequence of bytes.
constexpr size_t prependByte(uint8_t) const noexcept
Prepend a single byte.
constexpr size_t appendRange(Iterator first, Iterator last) const noexcept
Append bytes from the range [first, last)
constexpr size_t prependByteArrayBlock(uint32_t type, const uint8_t *array, size_t arraySize) const noexcept
Prepend TLV block of type type and value from buffer array of size arraySize.
constexpr size_t prependNonNegativeInteger(uint64_t n) const noexcept
Prepend n in NonNegativeInteger encoding.
constexpr size_t appendByteArrayBlock(uint32_t type, const uint8_t *array, size_t arraySize) const noexcept
Append TLV block of type type and value from buffer array of size arraySize.
constexpr size_t appendByte(uint8_t) const noexcept
Append a single byte.
constexpr size_t appendNonNegativeInteger(uint64_t n) const noexcept
Append n in NonNegativeInteger encoding.
constexpr size_t prependByteArray(const uint8_t *, size_t length) const noexcept
Prepend a byte array array of length length.
constexpr size_t appendBytes(span< const uint8_t > bytes) const noexcept
Append a sequence of bytes.
constexpr size_t appendVarNumber(uint64_t n) const noexcept
Append n in VarNumber encoding.
constexpr size_t appendByteArray(const uint8_t *, size_t length) const noexcept
Append a byte array array of length length.
constexpr size_t prependRange(Iterator first, Iterator last) const noexcept
Prepend bytes from the range [first, last)
size_t prependBlock(const Block &block) const
Prepend TLV block block.
constexpr size_t prependVarNumber(uint64_t n) const noexcept
Prepend n in VarNumber encoding.
constexpr size_t sizeOfVarNumber(uint64_t number) noexcept
Get the number of bytes necessary to hold the value of number encoded as VAR-NUMBER.
constexpr size_t sizeOfNonNegativeInteger(uint64_t integer) noexcept
Get the number of bytes necessary to hold the value of integer encoded as NonNegativeInteger.