Added --gen-name-strings command line option.

To support the use case described in issue google/flatbuffers#3826, a new command line option --gen-name-strings
has been added, which will cause a static GetFullyQualifiedName function to be added
to the C++ output for tables/structs.
This commit is contained in:
Nnamdi
2016-03-29 22:25:04 +01:00
parent a649cb7db5
commit 35f6bb5060
4 changed files with 53 additions and 26 deletions

View File

@@ -91,6 +91,14 @@
#else
#define FLATBUFFERS_FINAL_CLASS
#endif
#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \
(!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406))
#define FLATBUFFERS_CONSTEXPR constexpr
#else
#define FLATBUFFERS_CONSTEXPR
#endif
/// @endcond
/// @file

View File

@@ -321,6 +321,7 @@ struct IDLOptions {
bool proto_mode;
bool generate_all;
bool skip_unexpected_fields_in_json;
bool generate_name_strings;
// Possible options for the more general generator below.
enum Language { kJava, kCSharp, kGo, kMAX };
@@ -339,6 +340,7 @@ struct IDLOptions {
proto_mode(false),
generate_all(false),
skip_unexpected_fields_in_json(false),
generate_name_strings(false),
lang(IDLOptions::kJava) {}
};