| 41 | } |
| 42 | |
| 43 | bool 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 | |
| 64 | bool LocationManager::LoadFromFile(PCWSTR path) { |
| 65 | path = GetPath(path); |
nothing calls this directly
no test coverage detected