MCPcopy Create free account
hub / github.com/DFHack/dfhack / matchFocusString

Method matchFocusString

library/modules/Gui.cpp:924–935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922}
923
924bool Gui::matchFocusString(std::string focus_string, df::viewscreen *top) {
925 if (!top)
926 top = getCurViewscreen(true);
927
928 if (!cached_focus_strings.contains(top))
929 cached_focus_strings[top] = getFocusStrings(top);
930
931 vector<string> &cached = cached_focus_strings[top];
932 return std::find_if(cached.begin(), cached.end(), [&focus_string](const std::string &item) {
933 return prefix_matches(focus_string, item);
934 }) != cached.end();
935}
936
937static void push_dfhack_focus_string(dfhack_viewscreen *vs, std::vector<std::string> &focusStrings)
938{

Callers

nothing calls this directly

Calls 4

prefix_matchesFunction · 0.85
containsMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected