27#include "../../codec.h"
31int main(
int argc,
char* argv[])
34 for (
int i = 1; i < argc; ++i)
36 if (argv[i] && argv[i][0] ==
'-' && argv[i][1] ==
'v' && argv[i][2] ==
'\0')
40 dccl::dlog.connect(verbose ? dccl::logger::ALL : dccl::logger::WARN_PLUS, &std::cerr);
44 codec.
load<BytesMsg>();
45 codec.info<BytesMsg>(&dccl::dlog);
53 codec.encode(&encoded, msg_in);
56 codec.decode(encoded, &msg_out);
58 assert(msg_in.SerializeAsString() == msg_out.SerializeAsString());
60 dccl::dlog.is(dccl::logger::INFO) && dccl::dlog <<
"all tests passed" << std::endl;
The Dynamic CCL enCODer/DECoder. This is the main class you will use to load, encode and decode DCCL ...
std::size_t load()
All messages must be explicited loaded and validated (size checks, option extensions checks,...
void hex_decode(const std::string &in, std::string *out)
Decodes a (little-endian) hexadecimal string to a byte string. Index 0 and 1 (first byte) of in are w...