| 49 | savedSize = translationCache->size(); |
| 50 | } |
| 51 | void LoadCache() |
| 52 | { |
| 53 | translationCache->clear(); |
| 54 | std::ifstream stream(CacheFile(), std::ios::binary); |
| 55 | BlockMarkupIterator savedTranslations(stream, Array<std::wstring_view>{ L"|SENTENCE|", L"|TRANSLATION|" }); |
| 56 | auto translationCache = ::translationCache.Acquire(); |
| 57 | while (auto read = savedTranslations.Next()) |
| 58 | { |
| 59 | auto& [sentence, translation] = read.value(); |
| 60 | translationCache->try_emplace(std::move(sentence), std::move(translation)); |
| 61 | } |
| 62 | savedSize = translationCache->size(); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | class Window : public QDialog, Localizer |
no test coverage detected