| 128 | } |
| 129 | |
| 130 | bool Settings::Load(PCWSTR path) { |
| 131 | WCHAR fullpath[MAX_PATH]; |
| 132 | ::GetModuleFileName(nullptr, fullpath, _countof(fullpath)); |
| 133 | auto ch = fullpath[3]; |
| 134 | fullpath[3] = 0; |
| 135 | if (::GetDriveType(fullpath) == DRIVE_FIXED) |
| 136 | return LoadFromKey(path); |
| 137 | fullpath[3] = ch; |
| 138 | // exe to ini |
| 139 | wcscpy_s(fullpath + wcslen(fullpath) - 3, _countof(fullpath), L"ini"); |
| 140 | return LoadFromFile(fullpath); |
| 141 | } |
| 142 | |
| 143 | bool Settings::Save() const { |
| 144 | if (_path.empty()) |
no outgoing calls
no test coverage detected