mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Rules: Added settings accessors
This commit is contained in:
parent
f3aa253b07
commit
b612acf7ef
2 changed files with 160 additions and 6 deletions
19
src/Rules.h
19
src/Rules.h
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue