mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TW-1827: Extract annotations from a task
- Thanks to Ryan.
This commit is contained in:
parent
e71be41e72
commit
ce97fd5901
7 changed files with 40 additions and 0 deletions
11
src/Task.cpp
11
src/Task.cpp
|
@ -1032,6 +1032,17 @@ std::string Task::composeJSON (bool decorate /*= false*/) const
|
|||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int Task::getAnnotationCount () const
|
||||
{
|
||||
int count = 0;
|
||||
for (auto& ann : data)
|
||||
if (! ann.first.compare (0, 11, "annotation_", 11))
|
||||
++count;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Task::hasAnnotations () const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue