10 #ifndef NDN_BLOCK_HELPERS_HPP
11 #define NDN_BLOCK_HELPERS_HPP
44 dataBlock(uint32_t type,
const char* data,
size_t dataSize)
49 os.write(data, dataSize);
55 dataBlock(uint32_t type,
const unsigned char* data,
size_t dataSize)
57 return dataBlock(type, reinterpret_cast<const char*>(data), dataSize);
62 #endif // NDN_BLOCK_HELPERS_HPP
Class implementing interface similar to ostringstream, but to construct ndn::Buffer.
uint64_t readNonNegativeInteger(size_t size, InputIterator &begin, const InputIterator &end)
Read nonNegativeInteger in NDN-TLV encoding.
size_t writeVarNumber(std::ostream &os, uint64_t varNumber)
Write VAR-NUMBER to the specified stream.
Block nonNegativeIntegerBlock(uint32_t type, uint64_t value)
size_t sizeOfNonNegativeInteger(uint64_t varNumber)
Get number of bytes necessary to hold value of nonNegativeInteger.
Class representing wire element of the NDN packet.
Block booleanBlock(uint32_t type)
uint64_t readNonNegativeInteger(const Block &block)
Buffer::const_iterator value_begin() const
Buffer::const_iterator value_end() const
size_t writeNonNegativeInteger(std::ostream &os, uint64_t varNumber)
Write nonNegativeInteger to the specified stream.
ptr_lib::shared_ptr< Buffer > buf()
Flush written data to the stream and return shared pointer to the underlying buffer.
size_t value_size() const
Block dataBlock(uint32_t type, const char *data, size_t dataSize)