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

Function GetNamespace

native/thirdpart/flatbuffers/idl_parser.cpp:3520–3544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3518}
3519
3520static Namespace *GetNamespace(
3521 const std::string &qualified_name, std::vector<Namespace *> &namespaces,
3522 std::map<std::string, Namespace *> &namespaces_index) {
3523 size_t dot = qualified_name.find_last_of('.');
3524 std::string namespace_name = (dot != std::string::npos)
3525 ? std::string(qualified_name.c_str(), dot)
3526 : "";
3527 Namespace *&ns = namespaces_index[namespace_name];
3528
3529 if (!ns) {
3530 ns = new Namespace();
3531 namespaces.push_back(ns);
3532
3533 size_t pos = 0;
3534
3535 for (;;) {
3536 dot = qualified_name.find('.', pos);
3537 if (dot == std::string::npos) { break; }
3538 ns->components.push_back(qualified_name.substr(pos, dot - pos));
3539 pos = dot + 1;
3540 }
3541 }
3542
3543 return ns;
3544}
3545
3546Offset<reflection::Object> StructDef::Serialize(FlatBufferBuilder *builder,
3547 const Parser &parser) const {

Callers 1

DeserializeMethod · 0.85

Calls 2

push_backMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected