mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Rules: Added ::isRuleType
This commit is contained in:
parent
c9501f09dd
commit
35330b3f09
2 changed files with 11 additions and 0 deletions
|
@ -163,6 +163,15 @@ std::vector <std::string> Rules::all (const std::string& stem) const
|
|||
return items;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Rules::isRuleType (const std::string& type) const
|
||||
{
|
||||
if (std::find (_rule_types.begin (), _rule_types.end (), type) != _rule_types.end ())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Rules::dump () const
|
||||
{
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
void set (const std::string&, const std::string&);
|
||||
|
||||
std::vector <std::string> all (const std::string& stem = "") const;
|
||||
bool isRuleType (const std::string&) const;
|
||||
|
||||
std::string dump () const;
|
||||
|
||||
|
@ -66,6 +67,7 @@ private:
|
|||
private:
|
||||
std::string _original_file {};
|
||||
std::map <std::string, std::string> _settings {};
|
||||
std::vector <std::string> _rule_types {"tags", "reports", "theme", "holidays", "exclusions"};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue