39 if (
auto it = m_info.find(key); it != m_info.end()) {
55 return m_info.find(key) != m_info.end();
61 return m_info.begin();
73 return m_info.begin();
82 template<encoding::Tag TAG>
86 size_t totalLength = 0;
88 for (
auto it = m_info.rbegin(); it != m_info.rend(); it++) {
89 size_t entryLength = 0;
92 entryLength += encoder.prependVarNumber(entryLength);
95 totalLength += entryLength;
98 totalLength += encoder.prependVarNumber(totalLength);
117 m_wire = buffer.block();
127 NDN_THROW(
Error(
"The supplied block does not contain wire format"));
138 const Block& entry = *it;
149 NDN_THROW(
Error(
"Invalid DescriptionKey or DescriptionValue field"));
162 for (
const auto& entry : desc) {
163 join =
"(" + entry.first +
":" + entry.second +
")";
Represents a TLV element of the NDN packet format.
element_const_iterator elements_begin() const noexcept
Equivalent to elements().begin().
size_t elements_size() const noexcept
Equivalent to elements().size().
const element_container & elements() const noexcept
Get container of sub-elements.
element_const_iterator elements_end() const noexcept
Equivalent to elements().end().
bool hasWire() const noexcept
Check if the Block contains a fully encoded wire representation.
uint32_t type() const noexcept
Return the TLV-TYPE of the Block.
void parse() const
Parse TLV-VALUE into sub-elements.
Represents an AdditionalDescription TLV element.
std::map< std::string, std::string >::const_iterator const_iterator
bool has(const std::string &key) const
std::map< std::string, std::string >::iterator iterator
const Block & wireEncode() const
Encode ValidityPeriod into TLV block.
const std::string & get(const std::string &key) const
void wireDecode(const Block &wire)
Decode ValidityPeriod from TLV block.
AdditionalDescription()=default
Create an empty AdditionalDescription.
void set(const std::string &key, const std::string &value)
#define NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
EncodingImpl< EstimatorTag > EncodingEstimator
size_t prependStringBlock(EncodingImpl< TAG > &encoder, uint32_t type, std::string_view value)
Prepend a TLV element containing a string.
std::string readString(const Block &block)
Read the TLV-VALUE of a TLV element as a string.
EncodingImpl< EncoderTag > EncodingBuffer
Contains the ndn-cxx security framework.
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &desc)
constexpr size_t VALUE_OFFSET
constexpr size_t KEY_OFFSET
ostream_joiner< std::decay_t< DelimT >, CharT, Traits > make_ostream_joiner(std::basic_ostream< CharT, Traits > &os, DelimT &&delimiter)
Backport of ostream_joiner from the Library Fundamentals v2 TS.