mirror of
https://github.com/nanopb/nanopb.git
synced 2026-06-06 20:18:31 +00:00
Optionally generates a `myenum_valid()` function to check if a value belongs in enum.
19 lines
303 B
Protocol Buffer
19 lines
303 B
Protocol Buffer
/* Test enum to string function generation */
|
|
|
|
syntax = "proto2";
|
|
|
|
import "nanopb.proto";
|
|
|
|
option (nanopb_fileopt).enum_validate = true;
|
|
|
|
enum MyEnum {
|
|
VALUE1 = 1;
|
|
VALUE2 = 2;
|
|
VALUE15 = 15;
|
|
}
|
|
|
|
enum MyShortNameEnum {
|
|
option (nanopb_enumopt).long_names = false;
|
|
MSNE_VALUE256 = 256;
|
|
}
|