50 catch (
const t::Error&) {
55 return make_optional<Block>(os.
buf());
60 catch (
const std::invalid_argument&) {
85 catch (
const t::Error&) {
optional< Block > loadBlock(std::istream &is, IoEncoding encoding)
loads a TLV block from a stream
#define NDN_THROW_NESTED(e)
void saveBlock(const Block &block, std::ostream &os, IoEncoding encoding)
saves a TLV block to a stream
Represents a TLV element of NDN packet format.
size_t size() const
Return the size of the encoded wire, i.e.
shared_ptr< Buffer > buf()
Flush written data to the stream and return shared pointer to the underlying buffer.
const uint8_t * wire() const
Return a raw pointer to the beginning of the encoded wire.
implements an output stream that constructs ndn::Buffer
std::string to_string(const V &v)
const nullopt_t nullopt((nullopt_t::init()))
represents an error in TLV encoding or decoding
IoEncoding
indicates how a file or stream is encoded