Fixes #7345 to add the option to minify enums (#7566)

* Added cpp minified enums

* Update generated files

* remove initializer and fix comma

* Fix .gitignore

* Fix comma

* Add tests for cpp minify enums
This commit is contained in:
RishabhDeep Singh
2022-11-11 10:17:28 +05:30
committed by GitHub
parent 83e7a98f69
commit 879622fc57
6 changed files with 225 additions and 187 deletions

View File

@@ -0,0 +1,3 @@
enum Color : int {Red = 1, Blue, Orange}
enum Size: int {Small = 10, Large = 100, Medium = 1000}

View File

@@ -0,0 +1,26 @@
// automatically generated by the FlatBuffers compiler, do not modify
#ifndef FLATBUFFERS_GENERATED_ENUMS_H_
#define FLATBUFFERS_GENERATED_ENUMS_H_
#include "flatbuffers/flatbuffers.h"
// Ensure the included flatbuffers.h is the same version as when this file was
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 22 &&
FLATBUFFERS_VERSION_MINOR == 9 &&
FLATBUFFERS_VERSION_REVISION == 29,
"Non-compatible flatbuffers version included");
enum Color : int32_t {
Color_Red = 1,
Color_Blue = 2,
Color_Orange = 3
};
enum Size : int32_t {
Size_Small = 10,
Size_Large = 100,
Size_Medium = 1000
};
#endif // FLATBUFFERS_GENERATED_ENUMS_H_