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

Method SaveToKey

WinArk/Settings.cpp:46–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46bool Settings::SaveToKey(PCWSTR registryPath) const {
47 if (registryPath == nullptr)
48 registryPath = _path.c_str();
49
50 ATLASSERT(registryPath);
51 if (registryPath == nullptr)
52 return false;
53
54 CRegKey key;
55 key.Create(HKEY_CURRENT_USER, registryPath, nullptr, 0, KEY_WRITE);
56 if (!key)
57 return false;
58
59 for (auto& [name, setting] : _settings) {
60 key.SetValue(name.c_str(), (DWORD)setting.Type, setting.Buffer.get(), setting.Size);
61 }
62 return true;
63}
64
65bool Settings::LoadFromFile(PCWSTR path) {
66 if (path == nullptr)

Callers

nothing calls this directly

Calls 2

CreateMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected