Added --filename-suffix and --filename-ext to flatc (#5778)

* Fixed refractoring issue in reflection/generate_code.sh. Also, mv deletes the original file, so I don't need to clean it up manually in that case.

* Added --filename-suffix and --filename-ext to flatc

* Fixed typo and added example generation of suffix and extension for C++

* Removed extra ;

* Removed clang-format block from a region that didn't need it. Fixed an auto format of another clang-format block

* Added docs, fixed pointer alignment, removed suffix test file
This commit is contained in:
Derek Bailey
2020-03-02 10:15:23 -08:00
committed by GitHub
parent c9a30c9ca2
commit 6ff1898413
33 changed files with 452 additions and 432 deletions

View File

@@ -269,7 +269,7 @@ class GoGRPCGenerator : public flatbuffers::BaseGenerator {
public:
GoGRPCGenerator(const Parser &parser, const std::string &path,
const std::string &file_name)
: BaseGenerator(parser, path, file_name, "", "" /*Unused*/),
: BaseGenerator(parser, path, file_name, "", "" /*Unused*/, "go"),
parser_(parser),
path_(path),
file_name_(file_name) {}
@@ -346,7 +346,7 @@ class JavaGRPCGenerator : public flatbuffers::BaseGenerator {
public:
JavaGRPCGenerator(const Parser &parser, const std::string &path,
const std::string &file_name)
: BaseGenerator(parser, path, file_name, "", "." /*separator*/) {}
: BaseGenerator(parser, path, file_name, "", "." /*separator*/, "java") {}
bool generate() {
FlatBufFile file(parser_, file_name_, FlatBufFile::kLanguageJava);
@@ -415,7 +415,7 @@ class SwiftGRPCGenerator : public flatbuffers::BaseGenerator {
public:
SwiftGRPCGenerator(const Parser &parser, const std::string &path,
const std::string &filename)
: BaseGenerator(parser, path, filename, "", "" /*Unused*/) {}
: BaseGenerator(parser, path, filename, "", "" /*Unused*/, "swift") {}
bool generate() {
code_.Clear();