41 CertificateBundleDecoder::decode()
43 auto onThrow = make_scope_fail([
this] { m_hasError =
true; });
45 while (!m_bufferedData.empty()) {
48 std::tie(isOk, element) =
Block::fromBuffer(m_bufferedData.data(), m_bufferedData.size());
53 m_bufferedData.erase(m_bufferedData.begin(), m_bufferedData.begin() + element.
size());
static std::tuple< bool, Block > fromBuffer(ConstBufferPtr buffer, size_t offset)
Try to parse Block from a wire buffer.
std::string to_string(const T &val)
constexpr bool isCriticalType(uint32_t type)
Determine whether a TLV-TYPE is "critical" for evolvability purpose.
Represents a TLV element of the NDN packet format.
Buffer::const_iterator value_begin() const
Get begin iterator of TLV-VALUE.
size_t size() const
Return the size of the encoded wire, i.e.
util::Signal< CertificateBundleDecoder, Certificate > onCertDecoded
Emitted every time a certificate is successfully decoded.
Buffer::const_iterator value_end() const
Get end iterator of TLV-VALUE.
void append(const Block &block)
Append a bundle segment to the internal decoding buffer and trigger decoding.
uint32_t type() const
Return the TLV-TYPE of the Block.
represents an error in TLV encoding or decoding