2017-09-17 13:43:13 +02:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
class Config {
|
2017-09-17 20:07:38 +02:00
|
|
|
std::string path;
|
2017-09-17 13:43:13 +02:00
|
|
|
std::map<std::string, std::string> strings;
|
|
|
|
std::map<std::string, float> floats;
|
|
|
|
std::map<std::string, int> ints;
|
|
|
|
std::map<std::string, bool> bools;
|
|
|
|
public:
|
2017-09-17 20:07:38 +02:00
|
|
|
Config(std::string path);
|
2017-09-17 13:43:13 +02:00
|
|
|
void load();
|
|
|
|
void save();
|
|
|
|
void deleteValue(std::string key);
|
|
|
|
std::string getString(std::string key, std::string defaultvalue);
|
|
|
|
int getInt(std::string key, int defaultvalue);
|
|
|
|
float getFloat(std::string key, float defaultvalue);
|
|
|
|
bool getBool(std::string key, bool defaultvalue);
|
2017-09-24 00:15:28 +02:00
|
|
|
void setString(std::string key, std::string value);
|
|
|
|
void setInt(std::string key, int value);
|
|
|
|
void setFloat(std::string key, float value);
|
|
|
|
void setBool(std::string key, bool value);
|
2017-09-17 13:43:13 +02:00
|
|
|
~Config();
|
|
|
|
};
|
|
|
|
|