mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Interval: Added ::hasTag
This commit is contained in:
parent
b0a49480ba
commit
3652d6e91a
2 changed files with 7 additions and 0 deletions
|
@ -125,6 +125,12 @@ bool Interval::isEnded () const
|
||||||
return _end.toEpoch () > 0;
|
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
|
std::set <std::string> Interval::tags () const
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
bool isStarted () const;
|
bool isStarted () const;
|
||||||
bool isEnded () const;
|
bool isEnded () const;
|
||||||
|
|
||||||
|
bool hasTag (const std::string&) const;
|
||||||
std::set <std::string> tags () const;
|
std::set <std::string> tags () const;
|
||||||
void tag (const std::string&);
|
void tag (const std::string&);
|
||||||
void untag (const std::string&);
|
void untag (const std::string&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue