GobySoft / dccl

Dynamic Compact Control Language
Other
17 stars 13 forks source link

Strict mode #41

Closed tsaubergine closed 5 years ago

tsaubergine commented 5 years ago

Adds optional "strict mode" for default codecs to throw dccl::OutOfRangeException if fields are out of bounds at encode time.

To enable:

dccl::Codec codec;
codec.set_strict(true);

To disable (also the default)

codec.set_strict(false);

The codecs that support strict mode are given in src/test/dccl_strict/test.proto and should include all the default version 2 and 3 codecs that could be given out of bounds (that is all but enum, bool which are inherently bounded).