Rules: Added ::isRuleType

This commit is contained in:
Paul Beckingham 2016-05-05 19:36:55 -04:00
parent c9501f09dd
commit 35330b3f09
2 changed files with 11 additions and 0 deletions

View file

@ -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
{

View file

@ -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