| 62 | } |
| 63 | |
| 64 | bool LocationManager::LoadFromFile(PCWSTR path) { |
| 65 | path = GetPath(path); |
| 66 | if (!path) |
| 67 | return false; |
| 68 | |
| 69 | IniFile file(path); |
| 70 | if (!file.IsValid()) |
| 71 | return false; |
| 72 | |
| 73 | auto data = file.ReadSection(L"Location"); |
| 74 | for (auto& text : data) { |
| 75 | int n = text.Find(L'='); |
| 76 | _items.insert({ n < 0 ? text : text.Left(n),n < 0 ? text : text.Mid(n + 1) }); |
| 77 | } |
| 78 | |
| 79 | return true; |
| 80 | } |
| 81 | |
| 82 | bool LocationManager::SaveToFile(PCWSTR path) const { |
| 83 | path = GetPath(path); |
nothing calls this directly
no test coverage detected