MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / SaveToRegistry

Method SaveToRegistry

WinArk/LocationManager.cpp:43–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43bool LocationManager::SaveToRegistry(PCWSTR path) const {
44 if (_items.empty())
45 return true;
46
47 path = GetPath(path);
48 if (!path)
49 return false;
50
51 CRegKey key;
52 key.Create(HKEY_CURRENT_USER, path, nullptr, 0, KEY_WRITE);
53 if (!key)
54 return false;
55
56 CString text;
57 for (const auto& [name, value] : _items) {
58 text += name + L":" + value + L"\n";
59 }
60
61 return ERROR_SUCCESS == key.SetStringValue(L"Locations", text);
62}
63
64bool LocationManager::LoadFromFile(PCWSTR path) {
65 path = GetPath(path);

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
CreateMethod · 0.45
SetStringValueMethod · 0.45

Tested by

no test coverage detected