MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / CheckClash

Method CheckClash

native/thirdpart/flatbuffers/idl_parser.cpp:2429–2447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2427}
2428
2429CheckedError Parser::CheckClash(std::vector<FieldDef *> &fields,
2430 StructDef *struct_def, const char *suffix,
2431 BaseType basetype) {
2432 auto len = strlen(suffix);
2433 for (auto it = fields.begin(); it != fields.end(); ++it) {
2434 auto &fname = (*it)->name;
2435 if (fname.length() > len &&
2436 fname.compare(fname.length() - len, len, suffix) == 0 &&
2437 (*it)->value.type.base_type != BASE_TYPE_UTYPE) {
2438 auto field =
2439 struct_def->fields.Lookup(fname.substr(0, fname.length() - len));
2440 if (field && field->value.type.base_type == basetype)
2441 return Error("Field " + fname +
2442 " would clash with generated functions for field " +
2443 field->name);
2444 }
2445 }
2446 return NoError();
2447}
2448
2449bool Parser::SupportsOptionalScalars(const flatbuffers::IDLOptions &opts) {
2450 static FLATBUFFERS_CONSTEXPR unsigned long supported_langs =

Callers

nothing calls this directly

Calls 6

ErrorFunction · 0.85
NoErrorFunction · 0.85
lengthMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
LookupMethod · 0.45

Tested by

no test coverage detected