mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-11 15:37:27 +00:00
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:
@@ -29,7 +29,8 @@ class LobsterGenerator : public BaseGenerator {
|
||||
public:
|
||||
LobsterGenerator(const Parser &parser, const std::string &path,
|
||||
const std::string &file_name)
|
||||
: BaseGenerator(parser, path, file_name, "" /* not used */, "_") {
|
||||
: BaseGenerator(parser, path, file_name, "" /* not used */, "_",
|
||||
"lobster") {
|
||||
static const char *const keywords[] = {
|
||||
"nil", "true", "false", "return", "struct", "class",
|
||||
"import", "int", "float", "string", "any", "def",
|
||||
@@ -367,8 +368,8 @@ class LobsterGenerator : public BaseGenerator {
|
||||
auto &struct_def = **it;
|
||||
GenStruct(struct_def, &code);
|
||||
}
|
||||
return SaveFile((path_ + file_name_ + "_generated.lobster").c_str(), code,
|
||||
false);
|
||||
return SaveFile(GeneratedFileName(path_, file_name_, parser_.opts).c_str(),
|
||||
code, false);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user