mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 01:45:43 +00:00
Update idl_gen_fbs.cpp
This commit is contained in:
@@ -55,16 +55,15 @@ static void GenNameSpace(const Namespace &name_space, std::string *_schema,
|
|||||||
std::string GenerateFBS(const Parser &parser, const std::string &file_name, const bool &escape_proto_identifiers) {
|
std::string GenerateFBS(const Parser &parser, const std::string &file_name, const bool &escape_proto_identifiers) {
|
||||||
// Proto namespaces may clash with table names, so we have to prefix all:
|
// Proto namespaces may clash with table names, so we have to prefix all:
|
||||||
|
|
||||||
if (!escape_proto_identifiers) {
|
if (!escape_proto_identifiers) {
|
||||||
for (auto it = parser.namespaces_.begin(); it != parser.namespaces_.end();
|
for (auto it = parser.namespaces_.begin(); it != parser.namespaces_.end();
|
||||||
++it) {
|
++it) {
|
||||||
for (auto comp = (*it)->components.begin(); comp != (*it)->components.end();
|
for (auto comp = (*it)->components.begin(); comp != (*it)->components.end();
|
||||||
++comp) {
|
++comp) {
|
||||||
(*comp) = "_" + (*comp);
|
(*comp) = "_" + (*comp);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
std::string schema;
|
std::string schema;
|
||||||
schema += "// Generated from " + file_name + ".proto\n\n";
|
schema += "// Generated from " + file_name + ".proto\n\n";
|
||||||
if (parser.opts.include_dependence_headers) {
|
if (parser.opts.include_dependence_headers) {
|
||||||
|
|||||||
Reference in New Issue
Block a user