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