ndn::literals::block_literals Namespace Reference

Functions

Block operator""_block (const char *input, std::size_t len)
 Construct a Block from hexadecimal input. More...
 

Function Documentation

◆ operator""_block()

Block ndn::literals::block_literals::operator""_block ( const char *  input,
std::size_t  len 
)

Construct a Block from hexadecimal input.

Parameters
inputa string containing hexadecimal bytes and comments. 0-9 and upper-case A-F are input; all other characters are comments.
lenlength of input.
Exceptions
std::invalid_argumentinput is empty or has an odd number of hexadecimal digits.
tlv::Errorinput cannot be parsed into a valid Block.

Example:

Block nameBlock = "0706 080141 080142"_block;
Block nackBlock = "FD032005 reason(no-route)=FD03210196"_block;

Definition at line 523 of file block.cpp.