MCPcopy Create free account
hub / github.com/Artikash/Textractor / LoadCache

Function LoadCache

extensions/translatewrapper.cpp:51–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
66class Window : public QDialog, Localizer

Callers 1

SaveTranslateToMethod · 0.85

Calls 3

CacheFileFunction · 0.85
AcquireMethod · 0.80
NextMethod · 0.45

Tested by

no test coverage detected