aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlakedaemon <olivier.binda@wanadoo.fr>2016-05-26 15:26:58 +0200
committerlakedaemon <olivier.binda@wanadoo.fr>2016-05-26 15:26:58 +0200
commitcd1493b0829b48407887844921ef0e040c0f485a (patch)
tree184564662c7dbbc3f172657c577d96ea66bd146b
parent06eb6e94e34053ced993a4f689176f50e901439c (diff)
downloadflatbuffers-cd1493b0829b48407887844921ef0e040c0f485a.tar.gz
sharing the Flatbuffers warning
-rw-r--r--include/flatbuffers/code_generators.h5
-rw-r--r--samples/monster_generated.h19
-rw-r--r--src/idl_gen_cpp.cpp4
-rw-r--r--src/idl_gen_general.cpp79
-rw-r--r--src/idl_gen_go.cpp82
-rw-r--r--src/idl_gen_js.cpp4
-rw-r--r--src/idl_gen_php.cpp98
-rw-r--r--src/idl_gen_python.cpp86
-rw-r--r--tests/MyGame/Example/Any.cs2
-rw-r--r--tests/MyGame/Example/Any.go2
-rw-r--r--tests/MyGame/Example/Any.java2
-rw-r--r--tests/MyGame/Example/Any.php2
-rw-r--r--tests/MyGame/Example/Any.py2
-rw-r--r--tests/MyGame/Example/Color.cs2
-rw-r--r--tests/MyGame/Example/Color.go2
-rw-r--r--tests/MyGame/Example/Color.java2
-rw-r--r--tests/MyGame/Example/Color.php2
-rw-r--r--tests/MyGame/Example/Color.py2
-rw-r--r--tests/MyGame/Example/Monster.cs2
-rw-r--r--tests/MyGame/Example/Monster.go2
-rw-r--r--tests/MyGame/Example/Monster.java2
-rw-r--r--tests/MyGame/Example/Monster.php2
-rw-r--r--tests/MyGame/Example/Monster.py2
-rw-r--r--tests/MyGame/Example/Stat.cs2
-rw-r--r--tests/MyGame/Example/Stat.go2
-rw-r--r--tests/MyGame/Example/Stat.java2
-rw-r--r--tests/MyGame/Example/Stat.php2
-rw-r--r--tests/MyGame/Example/Stat.py2
-rw-r--r--tests/MyGame/Example/Test.cs2
-rw-r--r--tests/MyGame/Example/Test.go2
-rw-r--r--tests/MyGame/Example/Test.java2
-rw-r--r--tests/MyGame/Example/Test.php2
-rw-r--r--tests/MyGame/Example/Test.py2
-rw-r--r--tests/MyGame/Example/TestSimpleTableWithEnum.cs2
-rw-r--r--tests/MyGame/Example/TestSimpleTableWithEnum.go2
-rw-r--r--tests/MyGame/Example/TestSimpleTableWithEnum.java2
-rw-r--r--tests/MyGame/Example/TestSimpleTableWithEnum.php2
-rw-r--r--tests/MyGame/Example/TestSimpleTableWithEnum.py2
-rw-r--r--tests/MyGame/Example/Vec3.cs2
-rw-r--r--tests/MyGame/Example/Vec3.go2
-rw-r--r--tests/MyGame/Example/Vec3.java2
-rw-r--r--tests/MyGame/Example/Vec3.php2
-rw-r--r--tests/MyGame/Example/Vec3.py2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.cs2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.java2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.php2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.py2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.cs2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.java2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.php2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.py2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.java2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.php2
-rw-r--r--tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.py2
-rw-r--r--tests/namespace_test/NamespaceA/SecondTableInA.cs2
-rw-r--r--tests/namespace_test/NamespaceA/SecondTableInA.go2
-rw-r--r--tests/namespace_test/NamespaceA/SecondTableInA.java2
-rw-r--r--tests/namespace_test/NamespaceA/SecondTableInA.php2
-rw-r--r--tests/namespace_test/NamespaceA/SecondTableInA.py2
-rw-r--r--tests/namespace_test/NamespaceA/TableInC.cs2
-rw-r--r--tests/namespace_test/NamespaceA/TableInC.go2
-rw-r--r--tests/namespace_test/NamespaceA/TableInC.java2
-rw-r--r--tests/namespace_test/NamespaceA/TableInC.php2
-rw-r--r--tests/namespace_test/NamespaceA/TableInC.py2
-rw-r--r--tests/namespace_test/NamespaceA/TableInFirstNS.cs2
-rw-r--r--tests/namespace_test/NamespaceA/TableInFirstNS.go2
-rw-r--r--tests/namespace_test/NamespaceA/TableInFirstNS.java2
-rw-r--r--tests/namespace_test/NamespaceA/TableInFirstNS.php2
-rw-r--r--tests/namespace_test/NamespaceA/TableInFirstNS.py2
73 files changed, 255 insertions, 252 deletions
diff --git a/include/flatbuffers/code_generators.h b/include/flatbuffers/code_generators.h
index 5770932c..6c902a45 100644
--- a/include/flatbuffers/code_generators.h
+++ b/include/flatbuffers/code_generators.h
@@ -29,6 +29,11 @@ class BaseGenerator {
protected:
virtual ~BaseGenerator(){};
+ const char * FlatBuffersGeneratedWarning() {
+ return "automatically generated by the FlatBuffers compiler,"
+ " do not modify\n\n";
+ }
+
bool IsEverythingGenerated() {
for (auto it = parser_.enums_.vec.begin(); it != parser_.enums_.vec.end();
++it) {
diff --git a/samples/monster_generated.h b/samples/monster_generated.h
index cf45bbb9..1a16126a 100644
--- a/samples/monster_generated.h
+++ b/samples/monster_generated.h
@@ -5,12 +5,13 @@
#include "flatbuffers/flatbuffers.h"
-
namespace MyGame {
namespace Sample {
struct Vec3;
+
struct Monster;
+
struct Weapon;
enum Color {
@@ -55,8 +56,11 @@ MANUALLY_ALIGNED_STRUCT(4) Vec3 FLATBUFFERS_FINAL_CLASS {
: x_(flatbuffers::EndianScalar(_x)), y_(flatbuffers::EndianScalar(_y)), z_(flatbuffers::EndianScalar(_z)) { }
float x() const { return flatbuffers::EndianScalar(x_); }
+ void mutate_x(float _x) { flatbuffers::WriteScalar(&x_, _x); }
float y() const { return flatbuffers::EndianScalar(y_); }
+ void mutate_y(float _y) { flatbuffers::WriteScalar(&y_, _y); }
float z() const { return flatbuffers::EndianScalar(z_); }
+ void mutate_z(float _z) { flatbuffers::WriteScalar(&z_, _z); }
};
STRUCT_END(Vec3, 12);
@@ -73,14 +77,23 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
VT_EQUIPPED = 22
};
const Vec3 *pos() const { return GetStruct<const Vec3 *>(VT_POS); }
+ Vec3 *mutable_pos() { return GetStruct<Vec3 *>(VT_POS); }
int16_t mana() const { return GetField<int16_t>(VT_MANA, 150); }
+ bool mutate_mana(int16_t _mana) { return SetField(VT_MANA, _mana); }
int16_t hp() const { return GetField<int16_t>(VT_HP, 100); }
+ bool mutate_hp(int16_t _hp) { return SetField(VT_HP, _hp); }
const flatbuffers::String *name() const { return GetPointer<const flatbuffers::String *>(VT_NAME); }
+ flatbuffers::String *mutable_name() { return GetPointer<flatbuffers::String *>(VT_NAME); }
const flatbuffers::Vector<uint8_t> *inventory() const { return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_INVENTORY); }
+ flatbuffers::Vector<uint8_t> *mutable_inventory() { return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_INVENTORY); }
Color color() const { return static_cast<Color>(GetField<int8_t>(VT_COLOR, 2)); }
+ bool mutate_color(Color _color) { return SetField(VT_COLOR, static_cast<int8_t>(_color)); }
const flatbuffers::Vector<flatbuffers::Offset<Weapon>> *weapons() const { return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Weapon>> *>(VT_WEAPONS); }
+ flatbuffers::Vector<flatbuffers::Offset<Weapon>> *mutable_weapons() { return GetPointer<flatbuffers::Vector<flatbuffers::Offset<Weapon>> *>(VT_WEAPONS); }
Equipment equipped_type() const { return static_cast<Equipment>(GetField<uint8_t>(VT_EQUIPPED_TYPE, 0)); }
+ bool mutate_equipped_type(Equipment _equipped_type) { return SetField(VT_EQUIPPED_TYPE, static_cast<uint8_t>(_equipped_type)); }
const void *equipped() const { return GetPointer<const void *>(VT_EQUIPPED); }
+ void *mutable_equipped() { return GetPointer<void *>(VT_EQUIPPED); }
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<Vec3>(verifier, VT_POS) &&
@@ -150,7 +163,9 @@ struct Weapon FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
VT_DAMAGE = 6
};
const flatbuffers::String *name() const { return GetPointer<const flatbuffers::String *>(VT_NAME); }
+ flatbuffers::String *mutable_name() { return GetPointer<flatbuffers::String *>(VT_NAME); }
int16_t damage() const { return GetField<int16_t>(VT_DAMAGE, 0); }
+ bool mutate_damage(int16_t _damage) { return SetField(VT_DAMAGE, _damage); }
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, VT_NAME) &&
@@ -192,6 +207,8 @@ inline bool VerifyEquipment(flatbuffers::Verifier &verifier, const void *union_o
inline const MyGame::Sample::Monster *GetMonster(const void *buf) { return flatbuffers::GetRoot<MyGame::Sample::Monster>(buf); }
+inline Monster *GetMutableMonster(void *buf) { return flatbuffers::GetMutableRoot<Monster>(buf); }
+
inline bool VerifyMonsterBuffer(flatbuffers::Verifier &verifier) { return verifier.VerifyBuffer<MyGame::Sample::Monster>(); }
inline void FinishMonsterBuffer(flatbuffers::FlatBufferBuilder &fbb, flatbuffers::Offset<MyGame::Sample::Monster> root) { fbb.Finish(root); }
diff --git a/src/idl_gen_cpp.cpp b/src/idl_gen_cpp.cpp
index 051cd99d..0bec8ca5 100644
--- a/src/idl_gen_cpp.cpp
+++ b/src/idl_gen_cpp.cpp
@@ -733,9 +733,7 @@ class CppGenerator : public BaseGenerator {
if (IsEverythingGenerated()) return true;
std::string code;
- code =
- "// automatically generated by the FlatBuffers compiler,"
- " do not modify\n\n";
+ code = code + "// " + FlatBuffersGeneratedWarning();
// Generate include guard.
std::string include_guard_ident = file_name_;
diff --git a/src/idl_gen_general.cpp b/src/idl_gen_general.cpp
index 4a4e54dc..71ea19ed 100644
--- a/src/idl_gen_general.cpp
+++ b/src/idl_gen_general.cpp
@@ -1115,40 +1115,6 @@ static void GenStruct(const LanguageParameters &lang, const Parser &parser,
code += "};\n\n";
}
-// Save out the generated code for a single class while adding
-// declaration boilerplate.
-static bool SaveClass(const LanguageParameters &lang, const Parser &parser,
- const std::string &defname, const std::string &classcode,
- const std::string &path, bool needs_includes, bool onefile) {
- if (!classcode.length()) return true;
-
- std::string namespace_general;
- std::string namespace_dir = path; // Either empty or ends in separator.
- auto &namespaces = parser.namespaces_.back()->components;
- for (auto it = namespaces.begin(); it != namespaces.end(); ++it) {
- if (namespace_general.length()) {
- namespace_general += ".";
- }
- namespace_general += *it;
- if (!onefile) {
- namespace_dir += *it + kPathSeparator;
- }
-
- }
- EnsureDirExists(namespace_dir);
-
- std::string code = "// automatically generated, do not modify\n\n";
- if (!namespace_general.empty()) {
- code += lang.namespace_ident + namespace_general + lang.namespace_begin;
- code += "\n\n";
- }
- if (needs_includes) code += lang.includes;
- code += classcode;
- if (!namespace_general.empty()) code += lang.namespace_end;
- auto filename = namespace_dir + defname + lang.file_extension;
- return SaveFile(filename.c_str(), code, false);
-}
-
namespace general {
class GeneralGenerator : public BaseGenerator {
public:
@@ -1167,9 +1133,7 @@ class GeneralGenerator : public BaseGenerator {
if (parser_.opts.one_file) {
one_file_code += enumcode;
} else {
- if (!SaveClass(lang, parser_, (**it).name, enumcode, path_, false,
- false))
- return false;
+ if (!SaveType(lang, (**it).name, enumcode, false, false)) return false;
}
}
@@ -1180,18 +1144,49 @@ class GeneralGenerator : public BaseGenerator {
if (parser_.opts.one_file) {
one_file_code += declcode;
} else {
- if (!SaveClass(lang, parser_, (**it).name, declcode, path_, true,
- false))
- return false;
+ if (!SaveType(lang, (**it).name, declcode, true, false)) return false;
}
}
if (parser_.opts.one_file) {
- return SaveClass(lang, parser_, file_name_, one_file_code, path_, true,
- true);
+ return SaveType(lang, file_name_, one_file_code, true, true);
}
return true;
}
+
+ // Save out the generated code for a single class while adding
+ // declaration boilerplate.
+ bool SaveType(const LanguageParameters &lang, const std::string &defname,
+ const std::string &classcode, bool needs_includes,
+ bool onefile) {
+ if (!classcode.length()) return true;
+
+ std::string namespace_general;
+ std::string namespace_dir = path_; // Either empty or ends in separator.
+ auto &namespaces = parser_.namespaces_.back()->components;
+ for (auto it = namespaces.begin(); it != namespaces.end(); ++it) {
+ if (namespace_general.length()) {
+ namespace_general += ".";
+ }
+ namespace_general += *it;
+ if (!onefile) {
+ namespace_dir += *it + kPathSeparator;
+ }
+ }
+ EnsureDirExists(namespace_dir);
+
+ std::string code;
+ code = code + "// " + FlatBuffersGeneratedWarning();
+ if (!namespace_general.empty()) {
+ code += lang.namespace_ident + namespace_general + lang.namespace_begin;
+ code += "\n\n";
+ }
+ if (needs_includes) code += lang.includes;
+ code += classcode;
+ if (!namespace_general.empty()) code += lang.namespace_end;
+ auto filename = namespace_dir + defname + lang.file_extension;
+ return SaveFile(filename.c_str(), code, false);
+ }
};
} // namespace general
diff --git a/src/idl_gen_go.cpp b/src/idl_gen_go.cpp
index bce8f95b..be437c7b 100644
--- a/src/idl_gen_go.cpp
+++ b/src/idl_gen_go.cpp
@@ -53,20 +53,6 @@ std::string OffsetPrefix(const FieldDef &field) {
"))\n\tif o != 0 {\n";
}
-// Begin by declaring namespace and imports.
-static void BeginFile(const std::string name_space_name,
- const bool needs_imports,
- std::string *code_ptr) {
- std::string &code = *code_ptr;
- code += "// automatically generated, do not modify\n\n";
- code += "package " + name_space_name + "\n\n";
- if (needs_imports) {
- code += "import (\n";
- code += "\tflatbuffers \"github.com/google/flatbuffers/go\"\n";
- code += ")\n";
- }
-}
-
// Begin a class declaration.
static void BeginClass(const StructDef &struct_def, std::string *code_ptr) {
std::string &code = *code_ptr;
@@ -589,32 +575,6 @@ static std::string GenMethod(const FieldDef &field) {
: (IsStruct(field.value.type) ? "Struct" : "UOffsetT");
}
-
-// Save out the generated code for a Go Table type.
-static bool SaveType(const Parser &parser, const Definition &def,
- const std::string &classcode, const std::string &path,
- bool needs_imports) {
- if (!classcode.length()) return true;
-
- std::string namespace_name;
- std::string namespace_dir = path; // Either empty or ends in separator.
- auto &namespaces = parser.namespaces_.back()->components;
- for (auto it = namespaces.begin(); it != namespaces.end(); ++it) {
- if (namespace_name.length()) {
- namespace_name += ".";
- }
- namespace_name = *it;
- namespace_dir += *it + kPathSeparator;
- }
- EnsureDirExists(namespace_dir);
-
- std::string code = "";
- BeginFile(namespace_name, needs_imports, &code);
- code += classcode;
- std::string filename = namespace_dir + def.name + ".go";
- return SaveFile(filename.c_str(), code, false);
-}
-
static std::string GenTypeBasic(const Type &type) {
static const char *ctypename[] = {
#define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE, GTYPE, NTYPE, PTYPE) \
@@ -671,18 +631,56 @@ class GoGenerator : public BaseGenerator {
++it) {
std::string enumcode;
go::GenEnum(**it, &enumcode);
- if (!go::SaveType(parser_, **it, enumcode, path_, false)) return false;
+ if (!SaveType(**it, enumcode, false)) return false;
}
for (auto it = parser_.structs_.vec.begin();
it != parser_.structs_.vec.end(); ++it) {
std::string declcode;
go::GenStruct(**it, &declcode, parser_.root_struct_def_);
- if (!go::SaveType(parser_, **it, declcode, path_, true)) return false;
+ if (!SaveType(**it, declcode, true)) return false;
}
return true;
}
+
+ private:
+ // Begin by declaring namespace and imports.
+ void BeginFile(const std::string name_space_name, const bool needs_imports,
+ std::string *code_ptr) {
+ std::string &code = *code_ptr;
+ code = code + "// " + FlatBuffersGeneratedWarning();
+ code += "package " + name_space_name + "\n\n";
+ if (needs_imports) {
+ code += "import (\n";
+ code += "\tflatbuffers \"github.com/google/flatbuffers/go\"\n";
+ code += ")\n";
+ }
+ }
+
+ // Save out the generated code for a Go Table type.
+ bool SaveType(const Definition &def, const std::string &classcode,
+ bool needs_imports) {
+ if (!classcode.length()) return true;
+
+ std::string namespace_name;
+ std::string namespace_dir = path_; // Either empty or ends in separator.
+ auto &namespaces = parser_.namespaces_.back()->components;
+ for (auto it = namespaces.begin(); it != namespaces.end(); ++it) {
+ if (namespace_name.length()) {
+ namespace_name += ".";
+ }
+ namespace_name = *it;
+ namespace_dir += *it + kPathSeparator;
+ }
+ EnsureDirExists(namespace_dir);
+
+ std::string code = "";
+ BeginFile(namespace_name, needs_imports, &code);
+ code += classcode;
+ std::string filename = namespace_dir + def.name + ".go";
+ return SaveFile(filename.c_str(), code, false);
+ }
};
} // namespace go
diff --git a/src/idl_gen_js.cpp b/src/idl_gen_js.cpp
index 0265394e..d724b80f 100644
--- a/src/idl_gen_js.cpp
+++ b/src/idl_gen_js.cpp
@@ -684,9 +684,7 @@ class JsGenerator : public BaseGenerator {
generateEnums(&enum_code, &exports_code);
generateStructs(&struct_code, &exports_code);
- code +=
- "// automatically generated by the FlatBuffers compiler, do not "
- "modify\n\n";
+ code = code + "// " + FlatBuffersGeneratedWarning();
// Generate code for all the namespace declarations.
GenNamespaces(parser_, &code, &exports_code);
diff --git a/src/idl_gen_php.cpp b/src/idl_gen_php.cpp
index b43ea670..5fb41243 100644
--- a/src/idl_gen_php.cpp
+++ b/src/idl_gen_php.cpp
@@ -54,24 +54,6 @@ namespace php {
// Hardcode spaces per indentation.
const std::string Indent = " ";
- // Begin by declaring namespace and imports.
- static void BeginFile(const std::string name_space_name,
- const bool needs_imports,
- std::string *code_ptr) {
- std::string &code = *code_ptr;
- code += "<?php\n";
- code += "// automatically generated, do not modify\n\n";
- code += "namespace " + name_space_name + ";\n\n";
-
- if (needs_imports) {
- code += "use \\Google\\FlatBuffers\\Struct;\n";
- code += "use \\Google\\FlatBuffers\\Table;\n";
- code += "use \\Google\\FlatBuffers\\ByteBuffer;\n";
- code += "use \\Google\\FlatBuffers\\FlatBufferBuilder;\n";
- code += "\n";
- }
- }
-
// Begin a class declaration.
static void BeginClass(const StructDef &struct_def, std::string *code_ptr) {
std::string &code = *code_ptr;
@@ -867,35 +849,6 @@ namespace php {
: (IsStruct(field.value.type) ? "Struct" : "Offset");
}
-
- // Save out the generated code for a Php Table type.
- static bool SaveType(const Parser &parser, const Definition &def,
- const std::string &classcode, const std::string &path,
- bool needs_imports) {
- if (!classcode.length()) return true;
-
- std::string namespace_name;
- std::string namespace_dir = path;
-
- auto &namespaces = parser.namespaces_.back()->components;
- for (auto it = namespaces.begin(); it != namespaces.end(); ++it) {
- if (namespace_name.length()) {
- namespace_name += "\\";
- namespace_dir += kPathSeparator;
- }
- namespace_name += *it;
- namespace_dir += *it;
- EnsureDirExists(namespace_dir.c_str());
- }
-
- std::string code = "";
- BeginFile(namespace_name, needs_imports, &code);
- code += classcode;
-
- std::string filename = namespace_dir + kPathSeparator + def.name + ".php";
- return SaveFile(filename.c_str(), code, false);
- }
-
static std::string GenTypeBasic(const Type &type) {
static const char *ctypename[] = {
#define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE, GTYPE, NTYPE, PTYPE) \
@@ -993,8 +946,7 @@ namespace php {
auto &enum_def = **it;
std::string enumcode;
GenEnum(enum_def, &enumcode);
- if (!SaveType(parser_, enum_def, enumcode, path_, false))
- return false;
+ if (!SaveType(enum_def, enumcode, false)) return false;
}
return true;
}
@@ -1005,11 +957,55 @@ namespace php {
auto &struct_def = **it;
std::string declcode;
GenStruct(parser_, struct_def, &declcode);
- if (!SaveType(parser_, struct_def, declcode, path_, true))
- return false;
+ if (!SaveType(struct_def, declcode, true)) return false;
}
return true;
}
+
+ // Begin by declaring namespace and imports.
+ void BeginFile(const std::string name_space_name,
+ const bool needs_imports, std::string *code_ptr) {
+ std::string &code = *code_ptr;
+ code += "<?php\n";
+ code = code + "// " + FlatBuffersGeneratedWarning();
+ code += "namespace " + name_space_name + ";\n\n";
+
+ if (needs_imports) {
+ code += "use \\Google\\FlatBuffers\\Struct;\n";
+ code += "use \\Google\\FlatBuffers\\Table;\n";
+ code += "use \\Google\\FlatBuffers\\ByteBuffer;\n";
+ code += "use \\Google\\FlatBuffers\\FlatBufferBuilder;\n";
+ code += "\n";
+ }
+ }
+
+ // Save out the generated code for a Php Table type.
+ bool SaveType(const Definition &def, const std::string &classcode,
+ bool needs_imports) {
+ if (!classcode.length()) return true;
+
+ std::string namespace_name;
+ std::string namespace_dir = path_;
+
+ auto &namespaces = parser_.namespaces_.back()->components;
+ for (auto it = namespaces.begin(); it != namespaces.end(); ++it) {
+ if (namespace_name.length()) {
+ namespace_name += "\\";
+ namespace_dir += kPathSeparator;
+ }
+ namespace_name += *it;
+ namespace_dir += *it;
+ EnsureDirExists(namespace_dir.c_str());
+ }
+
+ std::string code = "";
+ BeginFile(namespace_name, needs_imports, &code);
+ code += classcode;
+
+ std::string filename =
+ namespace_dir + kPathSeparator + def.name + ".php";
+ return SaveFile(filename.c_str(), code, false);
+ }
};
} // namespace php
diff --git a/src/idl_gen_python.cpp b/src/idl_gen_python.cpp
index ee6d1687..291aada0 100644
--- a/src/idl_gen_python.cpp
+++ b/src/idl_gen_python.cpp
@@ -49,18 +49,6 @@ std::string OffsetPrefix(const FieldDef &field) {
"))\n" + Indent + Indent + "if o != 0:\n";
}
-// Begin by declaring namespace and imports.
-static void BeginFile(const std::string name_space_name,
- const bool needs_imports,
- std::string *code_ptr) {
- std::string &code = *code_ptr;
- code += "# automatically generated, do not modify\n\n";
- code += "# namespace: " + name_space_name + "\n\n";
- if (needs_imports) {
- code += "import flatbuffers\n\n";
- }
-}
-
// Begin a class declaration.
static void BeginClass(const StructDef &struct_def, std::string *code_ptr) {
std::string &code = *code_ptr;
@@ -558,37 +546,6 @@ static std::string GenMethod(const FieldDef &field) {
: (IsStruct(field.value.type) ? "Struct" : "UOffsetTRelative");
}
-
-// Save out the generated code for a Python Table type.
-static bool SaveType(const Parser &parser, const Definition &def,
- const std::string &classcode, const std::string &path,
- bool needs_imports) {
- if (!classcode.length()) return true;
-
- std::string namespace_name;
- std::string namespace_dir = path;
- auto &namespaces = parser.namespaces_.back()->components;
- for (auto it = namespaces.begin(); it != namespaces.end(); ++it) {
- if (namespace_name.length()) {
- namespace_name += ".";
- namespace_dir += kPathSeparator;
- }
- namespace_name = *it;
- namespace_dir += *it;
- EnsureDirExists(namespace_dir.c_str());
-
- std::string init_py_filename = namespace_dir + "/__init__.py";
- SaveFile(init_py_filename.c_str(), "", false);
- }
-
-
- std::string code = "";
- BeginFile(namespace_name, needs_imports, &code);
- code += classcode;
- std::string filename = namespace_dir + kPathSeparator + def.name + ".py";
- return SaveFile(filename.c_str(), code, false);
-}
-
static std::string GenTypeBasic(const Type &type) {
static const char *ctypename[] = {
#define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE, GTYPE, NTYPE, PTYPE) \
@@ -653,7 +610,7 @@ class PythonGenerator : public BaseGenerator {
auto &enum_def = **it;
std::string enumcode;
GenEnum(enum_def, &enumcode);
- if (!SaveType(parser_, enum_def, enumcode, path_, false)) return false;
+ if (!SaveType(enum_def, enumcode, false)) return false;
}
return true;
}
@@ -664,10 +621,49 @@ class PythonGenerator : public BaseGenerator {
auto &struct_def = **it;
std::string declcode;
GenStruct(struct_def, &declcode, parser_.root_struct_def_);
- if (!SaveType(parser_, struct_def, declcode, path_, true)) return false;
+ if (!SaveType(struct_def, declcode, true)) return false;
}
return true;
}
+
+ // Begin by declaring namespace and imports.
+ void BeginFile(const std::string name_space_name, const bool needs_imports,
+ std::string *code_ptr) {
+ std::string &code = *code_ptr;
+ code = code + "# " + FlatBuffersGeneratedWarning();
+ code += "# namespace: " + name_space_name + "\n\n";
+ if (needs_imports) {
+ code += "import flatbuffers\n\n";
+ }
+ }
+
+ // Save out the generated code for a Python Table type.
+ bool SaveType(const Definition &def, const std::string &classcode,
+ bool needs_imports) {
+ if (!classcode.length()) return true;
+
+ std::string namespace_name;
+ std::string namespace_dir = path_;
+ auto &namespaces = parser_.namespaces_.back()->components;
+ for (auto it = namespaces.begin(); it != namespaces.end(); ++it) {
+ if (namespace_name.length()) {
+ namespace_name += ".";
+ namespace_dir += kPathSeparator;
+ }
+ namespace_name = *it;
+ namespace_dir += *it;
+ EnsureDirExists(namespace_dir.c_str());
+
+ std::string init_py_filename = namespace_dir + "/__init__.py";
+ SaveFile(init_py_filename.c_str(), "", false);
+ }
+
+ std::string code = "";
+ BeginFile(namespace_name, needs_imports, &code);
+ code += classcode;
+ std::string filename = namespace_dir + kPathSeparator + def.name + ".py";
+ return SaveFile(filename.c_str(), code, false);
+ }
};
} // namespace python
diff --git a/tests/MyGame/Example/Any.cs b/tests/MyGame/Example/Any.cs
index a05a9185..1f018ad8 100644
--- a/tests/MyGame/Example/Any.cs
+++ b/tests/MyGame/Example/Any.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame.Example
{
diff --git a/tests/MyGame/Example/Any.go b/tests/MyGame/Example/Any.go
index a23de4cb..0322364c 100644
--- a/tests/MyGame/Example/Any.go
+++ b/tests/MyGame/Example/Any.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package Example
diff --git a/tests/MyGame/Example/Any.java b/tests/MyGame/Example/Any.java
index cdc3ec56..27dc1bcb 100644
--- a/tests/MyGame/Example/Any.java
+++ b/tests/MyGame/Example/Any.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package MyGame.Example;
diff --git a/tests/MyGame/Example/Any.php b/tests/MyGame/Example/Any.php
index d35bfd63..f04f4ad3 100644
--- a/tests/MyGame/Example/Any.php
+++ b/tests/MyGame/Example/Any.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame\Example;
diff --git a/tests/MyGame/Example/Any.py b/tests/MyGame/Example/Any.py
index a247b528..b642ede0 100644
--- a/tests/MyGame/Example/Any.py
+++ b/tests/MyGame/Example/Any.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: Example
diff --git a/tests/MyGame/Example/Color.cs b/tests/MyGame/Example/Color.cs
index 7843733e..625d040a 100644
--- a/tests/MyGame/Example/Color.cs
+++ b/tests/MyGame/Example/Color.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame.Example
{
diff --git a/tests/MyGame/Example/Color.go b/tests/MyGame/Example/Color.go
index 289a7b06..09f6d580 100644
--- a/tests/MyGame/Example/Color.go
+++ b/tests/MyGame/Example/Color.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package Example
diff --git a/tests/MyGame/Example/Color.java b/tests/MyGame/Example/Color.java
index 822d2bbf..502ec9fb 100644
--- a/tests/MyGame/Example/Color.java
+++ b/tests/MyGame/Example/Color.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package MyGame.Example;
diff --git a/tests/MyGame/Example/Color.php b/tests/MyGame/Example/Color.php
index 9de0e68f..70c7bfd9 100644
--- a/tests/MyGame/Example/Color.php
+++ b/tests/MyGame/Example/Color.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame\Example;
diff --git a/tests/MyGame/Example/Color.py b/tests/MyGame/Example/Color.py
index 18b147dc..36e80a36 100644
--- a/tests/MyGame/Example/Color.py
+++ b/tests/MyGame/Example/Color.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: Example
diff --git a/tests/MyGame/Example/Monster.cs b/tests/MyGame/Example/Monster.cs
index abe95ec8..6101f464 100644
--- a/tests/MyGame/Example/Monster.cs
+++ b/tests/MyGame/Example/Monster.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame.Example
{
diff --git a/tests/MyGame/Example/Monster.go b/tests/MyGame/Example/Monster.go
index 5aa4a73e..fbd849e8 100644
--- a/tests/MyGame/Example/Monster.go
+++ b/tests/MyGame/Example/Monster.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package Example
diff --git a/tests/MyGame/Example/Monster.java b/tests/MyGame/Example/Monster.java
index 69c97543..d85e4baa 100644
--- a/tests/MyGame/Example/Monster.java
+++ b/tests/MyGame/Example/Monster.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package MyGame.Example;
diff --git a/tests/MyGame/Example/Monster.php b/tests/MyGame/Example/Monster.php
index 879b7624..9f82d5a9 100644
--- a/tests/MyGame/Example/Monster.php
+++ b/tests/MyGame/Example/Monster.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame\Example;
diff --git a/tests/MyGame/Example/Monster.py b/tests/MyGame/Example/Monster.py
index 42b79939..4f1ca2df 100644
--- a/tests/MyGame/Example/Monster.py
+++ b/tests/MyGame/Example/Monster.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: Example
diff --git a/tests/MyGame/Example/Stat.cs b/tests/MyGame/Example/Stat.cs
index 2b3f5375..30eaee5e 100644
--- a/tests/MyGame/Example/Stat.cs
+++ b/tests/MyGame/Example/Stat.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame.Example
{
diff --git a/tests/MyGame/Example/Stat.go b/tests/MyGame/Example/Stat.go
index 936d5ec9..7c33716b 100644
--- a/tests/MyGame/Example/Stat.go
+++ b/tests/MyGame/Example/Stat.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package Example
diff --git a/tests/MyGame/Example/Stat.java b/tests/MyGame/Example/Stat.java
index dd371633..3cac509b 100644
--- a/tests/MyGame/Example/Stat.java
+++ b/tests/MyGame/Example/Stat.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package MyGame.Example;
diff --git a/tests/MyGame/Example/Stat.php b/tests/MyGame/Example/Stat.php
index c959ac7b..6ef70348 100644
--- a/tests/MyGame/Example/Stat.php
+++ b/tests/MyGame/Example/Stat.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame\Example;
diff --git a/tests/MyGame/Example/Stat.py b/tests/MyGame/Example/Stat.py
index 23bef0db..71577e86 100644
--- a/tests/MyGame/Example/Stat.py
+++ b/tests/MyGame/Example/Stat.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: Example
diff --git a/tests/MyGame/Example/Test.cs b/tests/MyGame/Example/Test.cs
index 5bd2e58d..bd82295f 100644
--- a/tests/MyGame/Example/Test.cs
+++ b/tests/MyGame/Example/Test.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame.Example
{
diff --git a/tests/MyGame/Example/Test.go b/tests/MyGame/Example/Test.go
index dc4de8ee..e849488d 100644
--- a/tests/MyGame/Example/Test.go
+++ b/tests/MyGame/Example/Test.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package Example
diff --git a/tests/MyGame/Example/Test.java b/tests/MyGame/Example/Test.java
index ffd7394f..52474152 100644
--- a/tests/MyGame/Example/Test.java
+++ b/tests/MyGame/Example/Test.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package MyGame.Example;
diff --git a/tests/MyGame/Example/Test.php b/tests/MyGame/Example/Test.php
index acc838a3..13cced00 100644
--- a/tests/MyGame/Example/Test.php
+++ b/tests/MyGame/Example/Test.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame\Example;
diff --git a/tests/MyGame/Example/Test.py b/tests/MyGame/Example/Test.py
index 4c4912a6..3b2fd45f 100644
--- a/tests/MyGame/Example/Test.py
+++ b/tests/MyGame/Example/Test.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: Example
diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.cs b/tests/MyGame/Example/TestSimpleTableWithEnum.cs
index c1bf571f..63cb9e19 100644
--- a/tests/MyGame/Example/TestSimpleTableWithEnum.cs
+++ b/tests/MyGame/Example/TestSimpleTableWithEnum.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame.Example
{
diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.go b/tests/MyGame/Example/TestSimpleTableWithEnum.go
index a26a53e4..fe9cf2db 100644
--- a/tests/MyGame/Example/TestSimpleTableWithEnum.go
+++ b/tests/MyGame/Example/TestSimpleTableWithEnum.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package Example
diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.java b/tests/MyGame/Example/TestSimpleTableWithEnum.java
index 3000cab4..85e18c2b 100644
--- a/tests/MyGame/Example/TestSimpleTableWithEnum.java
+++ b/tests/MyGame/Example/TestSimpleTableWithEnum.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package MyGame.Example;
diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.php b/tests/MyGame/Example/TestSimpleTableWithEnum.php
index 6181461e..d37481fc 100644
--- a/tests/MyGame/Example/TestSimpleTableWithEnum.php
+++ b/tests/MyGame/Example/TestSimpleTableWithEnum.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame\Example;
diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.py b/tests/MyGame/Example/TestSimpleTableWithEnum.py
index 7085995b..5b950979 100644
--- a/tests/MyGame/Example/TestSimpleTableWithEnum.py
+++ b/tests/MyGame/Example/TestSimpleTableWithEnum.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: Example
diff --git a/tests/MyGame/Example/Vec3.cs b/tests/MyGame/Example/Vec3.cs
index e5fa2f67..a6d21fac 100644
--- a/tests/MyGame/Example/Vec3.cs
+++ b/tests/MyGame/Example/Vec3.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame.Example
{
diff --git a/tests/MyGame/Example/Vec3.go b/tests/MyGame/Example/Vec3.go
index def0b4d1..082945ed 100644
--- a/tests/MyGame/Example/Vec3.go
+++ b/tests/MyGame/Example/Vec3.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package Example
diff --git a/tests/MyGame/Example/Vec3.java b/tests/MyGame/Example/Vec3.java
index 86edb6dc..7ae1ce20 100644
--- a/tests/MyGame/Example/Vec3.java
+++ b/tests/MyGame/Example/Vec3.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package MyGame.Example;
diff --git a/tests/MyGame/Example/Vec3.php b/tests/MyGame/Example/Vec3.php
index 022254ce..ab1a8275 100644
--- a/tests/MyGame/Example/Vec3.php
+++ b/tests/MyGame/Example/Vec3.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace MyGame\Example;
diff --git a/tests/MyGame/Example/Vec3.py b/tests/MyGame/Example/Vec3.py
index c4ddfe23..a354773e 100644
--- a/tests/MyGame/Example/Vec3.py
+++ b/tests/MyGame/Example/Vec3.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: Example
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.cs b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.cs
index e57e1dc7..5f979fe5 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.cs
+++ b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA.NamespaceB
{
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go
index 4de2d0e3..a1fe117c 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go
+++ b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceB
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.java b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.java
index a919ace6..ff555954 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.java
+++ b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.php b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.php
index a39c0d73..d51cb41c 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.php
+++ b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA\NamespaceB;
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.py b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.py
index 5de5be80..cb8218f0 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.py
+++ b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceB
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.cs b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.cs
index 7317f241..16b0f458 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.cs
+++ b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA.NamespaceB
{
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go
index 66943e3c..f3684623 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go
+++ b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceB
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.java b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.java
index dfbe23e8..93f80522 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.java
+++ b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.php b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.php
index 962ea2c6..d3054841 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.php
+++ b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA\NamespaceB;
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.py b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.py
index ae3f9402..59cceaa6 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.py
+++ b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceB
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs
index dec8da9e..b983cd0e 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs
+++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA.NamespaceB
{
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go
index 09815c45..cf2b557c 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go
+++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceB
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.java b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.java
index 344005d5..2cfb1bac 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.java
+++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.php b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.php
index 6bedae9d..d16379d8 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.php
+++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA\NamespaceB;
diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.py b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.py
index 834103bf..e8e1f2ba 100644
--- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.py
+++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceB
diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.cs b/tests/namespace_test/NamespaceA/SecondTableInA.cs
index 11bf90fd..96ae378f 100644
--- a/tests/namespace_test/NamespaceA/SecondTableInA.cs
+++ b/tests/namespace_test/NamespaceA/SecondTableInA.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA
{
diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.go b/tests/namespace_test/NamespaceA/SecondTableInA.go
index 78514388..efc7713f 100644
--- a/tests/namespace_test/NamespaceA/SecondTableInA.go
+++ b/tests/namespace_test/NamespaceA/SecondTableInA.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA
diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.java b/tests/namespace_test/NamespaceA/SecondTableInA.java
index b1fa7a7e..acabc393 100644
--- a/tests/namespace_test/NamespaceA/SecondTableInA.java
+++ b/tests/namespace_test/NamespaceA/SecondTableInA.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA;
diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.php b/tests/namespace_test/NamespaceA/SecondTableInA.php
index 78dc27f5..c9bc65c1 100644
--- a/tests/namespace_test/NamespaceA/SecondTableInA.php
+++ b/tests/namespace_test/NamespaceA/SecondTableInA.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA;
diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.py b/tests/namespace_test/NamespaceA/SecondTableInA.py
index f7015394..ab11701a 100644
--- a/tests/namespace_test/NamespaceA/SecondTableInA.py
+++ b/tests/namespace_test/NamespaceA/SecondTableInA.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceA
diff --git a/tests/namespace_test/NamespaceA/TableInC.cs b/tests/namespace_test/NamespaceA/TableInC.cs
index 19576df1..98f4e138 100644
--- a/tests/namespace_test/NamespaceA/TableInC.cs
+++ b/tests/namespace_test/NamespaceA/TableInC.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA
{
diff --git a/tests/namespace_test/NamespaceA/TableInC.go b/tests/namespace_test/NamespaceA/TableInC.go
index 535493f6..6f3d3f21 100644
--- a/tests/namespace_test/NamespaceA/TableInC.go
+++ b/tests/namespace_test/NamespaceA/TableInC.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA
diff --git a/tests/namespace_test/NamespaceA/TableInC.java b/tests/namespace_test/NamespaceA/TableInC.java
index 36e3cf19..38fb3ab3 100644
--- a/tests/namespace_test/NamespaceA/TableInC.java
+++ b/tests/namespace_test/NamespaceA/TableInC.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA;
diff --git a/tests/namespace_test/NamespaceA/TableInC.php b/tests/namespace_test/NamespaceA/TableInC.php
index e0222623..49705f82 100644
--- a/tests/namespace_test/NamespaceA/TableInC.php
+++ b/tests/namespace_test/NamespaceA/TableInC.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA;
diff --git a/tests/namespace_test/NamespaceA/TableInC.py b/tests/namespace_test/NamespaceA/TableInC.py
index bc101a7e..4afea1af 100644
--- a/tests/namespace_test/NamespaceA/TableInC.py
+++ b/tests/namespace_test/NamespaceA/TableInC.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceA
diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.cs b/tests/namespace_test/NamespaceA/TableInFirstNS.cs
index a5f6ee27..4b4be117 100644
--- a/tests/namespace_test/NamespaceA/TableInFirstNS.cs
+++ b/tests/namespace_test/NamespaceA/TableInFirstNS.cs
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA
{
diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.go b/tests/namespace_test/NamespaceA/TableInFirstNS.go
index 2f6f7267..5580d5d5 100644
--- a/tests/namespace_test/NamespaceA/TableInFirstNS.go
+++ b/tests/namespace_test/NamespaceA/TableInFirstNS.go
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA
diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.java b/tests/namespace_test/NamespaceA/TableInFirstNS.java
index c92c0f38..87397930 100644
--- a/tests/namespace_test/NamespaceA/TableInFirstNS.java
+++ b/tests/namespace_test/NamespaceA/TableInFirstNS.java
@@ -1,4 +1,4 @@
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA;
diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.php b/tests/namespace_test/NamespaceA/TableInFirstNS.php
index 57a827bc..9fb29c37 100644
--- a/tests/namespace_test/NamespaceA/TableInFirstNS.php
+++ b/tests/namespace_test/NamespaceA/TableInFirstNS.php
@@ -1,5 +1,5 @@
<?php
-// automatically generated, do not modify
+// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA;
diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.py b/tests/namespace_test/NamespaceA/TableInFirstNS.py
index eb09014c..3a652f49 100644
--- a/tests/namespace_test/NamespaceA/TableInFirstNS.py
+++ b/tests/namespace_test/NamespaceA/TableInFirstNS.py
@@ -1,4 +1,4 @@
-# automatically generated, do not modify
+# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceA