PassRefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> > searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex) { RefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> > result = TypeBuilder::Array<TypeBuilder::Page::SearchMatch>::create(); OwnPtr<ScriptRegexp> regex = ContentSearchUtils::createSearchRegex(query, caseSensitive, isRegex); Vector<pair<int, String> > matches = getScriptRegexpMatchesByLines(regex.get(), text); for (Vector<pair<int, String> >::const_iterator it = matches.begin(); it != matches.end(); ++it) result->addItem(buildObjectForSearchMatch(it->first, it->second)); return result; }
PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex) { RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::SearchMatch>> result = TypeBuilder::Array<TypeBuilder::Debugger::SearchMatch>::create(); OwnPtr<ScriptRegexp> regex = ContentSearchUtils::createSearchRegex(query, caseSensitive, isRegex); Vector<std::pair<int, String>> matches = getScriptRegexpMatchesByLines(regex.get(), text); for (const auto& match : matches) result->addItem(buildObjectForSearchMatch(match.first, match.second)); return result; }