mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 14:10:03 +00:00
idl_gen_cpp.cpp: clang-format run, to better separate changes in content from formatting.
This commit is contained in:
@@ -139,7 +139,8 @@ class CppGenerator : public BaseGenerator {
|
|||||||
"while",
|
"while",
|
||||||
"xor",
|
"xor",
|
||||||
"xor_eq",
|
"xor_eq",
|
||||||
nullptr };
|
nullptr,
|
||||||
|
};
|
||||||
for (auto kw = keywords; *kw; kw++) keywords_.insert(*kw);
|
for (auto kw = keywords; *kw; kw++) keywords_.insert(*kw);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,8 +582,7 @@ class CppGenerator : public BaseGenerator {
|
|||||||
bool is_constructor) {
|
bool is_constructor) {
|
||||||
auto &ptr_type = PtrType(field);
|
auto &ptr_type = PtrType(field);
|
||||||
if (ptr_type != "naked") {
|
if (ptr_type != "naked") {
|
||||||
return (ptr_type != "default_ptr_type" ? ptr_type :
|
return (ptr_type != "default_ptr_type" ? ptr_type : parser_.opts.cpp_object_api_pointer_type) + "<" + type + ">";
|
||||||
parser_.opts.cpp_object_api_pointer_type) + "<" + type + ">";
|
|
||||||
} else if (is_constructor) {
|
} else if (is_constructor) {
|
||||||
return "";
|
return "";
|
||||||
} else {
|
} else {
|
||||||
@@ -1706,7 +1706,6 @@ class CppGenerator : public BaseGenerator {
|
|||||||
code_ += " }";
|
code_ += " }";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GenFullyQualifiedNameGetter(struct_def, Name(struct_def));
|
GenFullyQualifiedNameGetter(struct_def, Name(struct_def));
|
||||||
|
|
||||||
// Generate field id constants.
|
// Generate field id constants.
|
||||||
@@ -2064,7 +2063,8 @@ class CppGenerator : public BaseGenerator {
|
|||||||
|
|
||||||
// Generate a CreateXDirect function with vector types as parameters
|
// Generate a CreateXDirect function with vector types as parameters
|
||||||
if (has_string_or_vector_fields) {
|
if (has_string_or_vector_fields) {
|
||||||
code_ += "inline flatbuffers::Offset<{{STRUCT_NAME}}> "
|
code_ +=
|
||||||
|
"inline flatbuffers::Offset<{{STRUCT_NAME}}> "
|
||||||
"Create{{STRUCT_NAME}}Direct(";
|
"Create{{STRUCT_NAME}}Direct(";
|
||||||
code_ += " flatbuffers::FlatBufferBuilder &_fbb\\";
|
code_ += " flatbuffers::FlatBufferBuilder &_fbb\\";
|
||||||
for (auto it = struct_def.fields.vec.begin();
|
for (auto it = struct_def.fields.vec.begin();
|
||||||
@@ -2294,7 +2294,6 @@ class CppGenerator : public BaseGenerator {
|
|||||||
type + ">((*_rehasher)(" + value + GenPtrGet(field) + ")) : 0";
|
type + ">((*_rehasher)(" + value + GenPtrGet(field) + ")) : 0";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string code;
|
std::string code;
|
||||||
switch (field.value.type.base_type) {
|
switch (field.value.type.base_type) {
|
||||||
// String fields are of the form:
|
// String fields are of the form:
|
||||||
|
|||||||
Reference in New Issue
Block a user