MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Find

Method Find

apps/tools/Tools/commands/ConfigCommand.cpp:603–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601 struct Finder
602 {
603 static void Find(const ParamClass& cls, const std::string& prefix, const std::string& name,
604 std::vector<std::string>& results)
605 {
606 std::string nameLower = name;
607 std::transform(nameLower.begin(), nameLower.end(), nameLower.begin(), ::tolower);
608 for (int i = 0; i < cls.GetEntryCount(); i++)
609 {
610 const ParamEntry& e = cls.GetEntry(i);
611 std::string en = e.GetName().Data();
612 std::string enLower = en;
613 std::transform(enLower.begin(), enLower.end(), enLower.begin(), ::tolower);
614 std::string path = prefix.empty() ? en : prefix + " >> " + en;
615 if (enLower.find(nameLower) != std::string::npos)
616 results.push_back(path);
617 if (e.IsClass())
618 {
619 const ParamClass* sub = e.GetClassInterface();
620 if (sub)
621 Find(*sub, path, name, results);
622 }
623 }
624 }
625 };
626 std::vector<std::string> results;
627 Finder::Find(cfg, "", q, results);

Callers

nothing calls this directly

Calls 7

FindFunction · 0.85
GetClassInterfaceMethod · 0.80
GetEntryCountMethod · 0.45
DataMethod · 0.45
GetNameMethod · 0.45
emptyMethod · 0.45
IsClassMethod · 0.45

Tested by

no test coverage detected