Interval: Added ::hasTag

This commit is contained in:
Paul Beckingham 2016-04-09 00:16:24 -04:00
parent b0a49480ba
commit 3652d6e91a
2 changed files with 7 additions and 0 deletions

View file

@ -125,6 +125,12 @@ bool Interval::isEnded () const
return _end.toEpoch () > 0;
}
////////////////////////////////////////////////////////////////////////////////
bool Interval::hasTag (const std::string& tag) const
{
return std::find (_tags.begin (), _tags.end (), tag) != _tags.end ();
}
////////////////////////////////////////////////////////////////////////////////
std::set <std::string> Interval::tags () const
{

View file

@ -47,6 +47,7 @@ public:
bool isStarted () const;
bool isEnded () const;
bool hasTag (const std::string&) const;
std::set <std::string> tags () const;
void tag (const std::string&);
void untag (const std::string&);