27 lines
563 B
C++
27 lines
563 B
C++
#ifndef CONFIGURATION_HPP_INCLUDED
|
|
#define CONFIGURATION_HPP_INCLUDED
|
|
|
|
#include <map>
|
|
|
|
class Configuration
|
|
{
|
|
public:
|
|
Configuration() {}
|
|
bool load(const std::string & filename);
|
|
bool save(const std::string & filename);
|
|
|
|
// Getters
|
|
const std::string & get(const std::string & key) const;
|
|
bool getBool(const std::string & key) const;
|
|
int getInt(const std::string & key) const;
|
|
|
|
// Setters
|
|
void set(const std::string & key, const std::string & value);
|
|
protected:
|
|
void readLine(std::string & line);
|
|
|
|
std::map<std::string, std::string> settings;
|
|
};
|
|
|
|
#endif
|