#include <Windows.h>
#include <string>
class IniFile {
public:
IniFile(const std::wstring& path) : m_path(path) {}
std::wstring GetValue(const std::wstring& section, const std::wstring& key, const std::wstring& defaultValue = L"") {
wchar_t buf[1024];
GetPrivateProfileString(section.c_str(), key.c_str(), defaultValue.c_str(), buf, 1024, m_path.c_str());
return buf;
}
void SetValue(const std::wstring& section, const std::wstring& key, const std::wstring& value) {
WritePrivateProfileString(section.c_str(), key.c_str(), value.c_str(), m_path.c_str());
}
private:
std::wstring m_path;
};