| 55 | } window; |
| 56 | |
| 57 | bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) |
| 58 | { |
| 59 | static auto _ = GetSelectedProcessId = (DWORD(*)())sentenceInfo["get selected process id"]; |
| 60 | if (sentenceInfo["text number"] == 0) return false; |
| 61 | if (/*sentenceInfo["current select"] && */!regex) if (auto processName = GetModuleFilename(sentenceInfo["process id"])) |
| 62 | { |
| 63 | std::ifstream stream(REGEX_SAVE_FILE, std::ios::binary); |
| 64 | BlockMarkupIterator savedFilters(stream, Array<std::wstring_view>{ L"|PROCESS|", L"|FILTER|" }); |
| 65 | std::vector<std::wstring> regexes; |
| 66 | while (auto read = savedFilters.Next()) if (read->at(0) == processName) regexes.push_back(std::move(read->at(1))); |
| 67 | if (!regexes.empty()) QMetaObject::invokeMethod(&window, std::bind(&Window::SetRegex, &window, S(regexes.back())), Qt::BlockingQueuedConnection); |
| 68 | } |
| 69 | concurrency::reader_writer_lock::scoped_lock_read readLock(m); |
| 70 | if (regex) sentence = std::regex_replace(sentence, regex.value(), replace); |
| 71 | return true; |
| 72 | } |
nothing calls this directly
no test coverage detected