Skip to content
Snippets Groups Projects
Commit 40fffc8f authored by Amol Deshpande's avatar Amol Deshpande
Browse files

fix code formatting and bug with losing enums when using --gen-onefile

parent 2f761418
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,8 @@ be generated for each file processed: ...@@ -57,6 +57,8 @@ be generated for each file processed:
- `--gen-mutable` : Generate additional non-const accessors for mutating - `--gen-mutable` : Generate additional non-const accessors for mutating
FlatBuffers in-place. FlatBuffers in-place.
- `--gen-onefile` : Generate single output file (useful for C#)
- `--raw-binary` : Allow binaries without a file_indentifier to be read. - `--raw-binary` : Allow binaries without a file_indentifier to be read.
This may crash flatc given a mismatched schema. This may crash flatc given a mismatched schema.
......
...@@ -141,9 +141,9 @@ int main(int argc, const char *argv[]) { ...@@ -141,9 +141,9 @@ int main(int argc, const char *argv[]) {
opts.mutable_buffer = true; opts.mutable_buffer = true;
} else if(arg == "--gen-includes") { } else if(arg == "--gen-includes") {
opts.include_dependence_headers = true; opts.include_dependence_headers = true;
}else if (arg == "--gen-onefile") { } else if (arg == "--gen-onefile") {
opts.one_file = true; opts.one_file = true;
}else if (arg == "--raw-binary") { } else if (arg == "--raw-binary") {
raw_binary = true; raw_binary = true;
} else if(arg == "--") { // Separator between text and binary inputs. } else if(arg == "--") { // Separator between text and binary inputs.
binary_files_from = filenames.size(); binary_files_from = filenames.size();
......
...@@ -901,7 +901,7 @@ bool GenerateGeneral(const Parser &parser, ...@@ -901,7 +901,7 @@ bool GenerateGeneral(const Parser &parser,
std::string enumcode; std::string enumcode;
GenEnum(lang, **it, &enumcode); GenEnum(lang, **it, &enumcode);
if (opts.one_file) { if (opts.one_file) {
one_file_code = enumcode; one_file_code += enumcode;
} }
else { else {
if (!SaveClass(lang, parser, (**it).name, enumcode, path, false, false)) if (!SaveClass(lang, parser, (**it).name, enumcode, path, false, false))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment