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

Method recursiveElements

native/desc/Element.cpp:98–107  ·  view source on GitHub ↗

Select elements if it satisfies bool function func \param func bool function \param result the vector for storing elements satisfying bool function func

Source from the content-addressed store, hash-verified

96/// \param func bool function
97/// \param result the vector for storing elements satisfying bool function func
98 void Element::recursiveElements(const std::function<bool(ElementPtr)> &func,
99 std::vector<ElementPtr> &result) const {
100 if (func != nullptr) {
101 for (const auto &child: this->_children) {
102 if (func(child))
103 result.push_back(child);
104 child->recursiveElements(func, result);
105 }
106 }
107 }
108
109 void Element::recursiveDoElements(const std::function<void(std::shared_ptr<Element>)> &doFunc) {
110 if (doFunc != nullptr) {

Callers 1

resolveBlackWidgetsMethod · 0.80

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected