50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
#ifndef INI_H
|
|
#define INI_H
|
|
|
|
#include <string>
|
|
#include <fstream>
|
|
#include <util.h>
|
|
#include <filesystem>
|
|
#include <ios>
|
|
|
|
namespace fs = std::filesystem;
|
|
|
|
namespace ini
|
|
{
|
|
|
|
class IniHelper
|
|
{
|
|
private:
|
|
std::fstream handle;
|
|
|
|
public:
|
|
IniHelper()
|
|
{
|
|
auto path = (fs::current_path() / "ini.ini").string();
|
|
std::cout << path <<std::endl;
|
|
handle = std::fstream(path, std::ios::ate);
|
|
}
|
|
|
|
IniHelper(const std::string& file_path)
|
|
{
|
|
handle = std::fstream(file_path);
|
|
}
|
|
|
|
~IniHelper() noexcept = default;
|
|
|
|
template <typename T = std::string>
|
|
inline T GetValue(const std::string §ion, const std::string &key, T &&default_value)
|
|
{
|
|
throw std::exception("Not Implemented");
|
|
}
|
|
|
|
template <typename T = std::string>
|
|
inline bool SaveValue(const std::string §ion, const std::string &key, T &&default_value)
|
|
{
|
|
throw std::exception("Not Implemented");
|
|
}
|
|
};
|
|
|
|
}
|
|
|
|
#endif // !INI_H
|