Rules: Added settings accessors

This commit is contained in:
Paul Beckingham 2016-03-17 22:41:32 -04:00
parent f3aa253b07
commit b612acf7ef
2 changed files with 160 additions and 6 deletions

View file

@ -27,6 +27,8 @@
#ifndef INCLUDED_RULES
#define INCLUDED_RULES
#include <map>
#include <vector>
#include <string>
class Rules
@ -34,14 +36,27 @@ class Rules
public:
Rules () = default;
void load (const std::string&, int next = 1);
std::string get (const std::string&, const std::string&) const;
bool has (const std::string&) const;
std::string get (const std::string&) const;
int getInteger (const std::string&) const;
double getReal (const std::string&) const;
bool getBoolean (const std::string&) const;
void set (const std::string&, const int);
void set (const std::string&, const double);
void set (const std::string&, const std::string&);
std::vector <std::string> all () const;
std::string dump () const;
private:
void parse (const std::string&, int next = 1);
private:
std::string _original_file {};
std::string _original_file {};
std::map <std::string, std::string> _settings {};
};
#endif