| 71 | return GetPrivateProfileIntA(pszKey, pszItem, iDefault, configPath().c_str()); |
| 72 | } |
| 73 | void WriteConfig(const char *pszKey, const char *pszItem, const std::string& value) |
| 74 | { |
| 75 | // avoid writing unless the value is actually different, because writing causes |
| 76 | // an annoying popup when having the file open in e.g. notepad++ |
| 77 | if (LoadConfigStringFromFile(pszKey, pszItem, "_NULL") != value) |
| 78 | WritePrivateProfileStringA(pszKey, pszItem, value.c_str(), configPath().c_str()); |
| 79 | } |
| 80 | void WriteConfig(const char *pszKey, const char *pszItem, int value) |
| 81 | { |
| 82 | WriteConfig(pszKey, pszItem, std::to_string(value)); |
no test coverage detected