MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ProcessSnippet

Function ProcessSnippet

src/WorkerImplement.cpp:218–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216
217namespace {
218 void ProcessSnippet(const string& s) {
219 if (s.empty()) return;
220 auto parts = ParseSnippet(s);
221 InputSender is;
222 for (const auto& it : parts) {
223
224 // VK_CODE
225 if (it.inBrackets) {
226 for (const auto& hk_string : StrUtils::Split(it.text, ',')) {
227 auto hk = CHotKey::FromString(hk_string);
228 is.AddPressVk(hk);
229 }
230 continue;
231 }
232
233 // UNICODE
234 auto str = StrUtils::Convert(it.text);
235 for (auto c : str) {
236 is.AddUnicodePress(c);
237 }
238
239 }
240 is.Send();
241 }
242}
243
244TStatus WorkerImplement::RunProcess(HotKeyType hk, bool after_wait) {

Callers 1

RunProcessMethod · 0.85

Calls 7

ParseSnippetFunction · 0.85
SplitFunction · 0.85
AddPressVkMethod · 0.80
AddUnicodePressMethod · 0.80
SendMethod · 0.80
ConvertFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected