Expose is_* methods on tasks.

This commit is contained in:
Dustin J. Mitchell 2022-12-18 21:35:56 +00:00 committed by Dustin J. Mitchell
parent 7c27f116ad
commit 88333ac785
5 changed files with 53 additions and 3 deletions

View file

@ -99,6 +99,30 @@ std::string tc::Task::get_description () const
return tc2string(desc);
}
////////////////////////////////////////////////////////////////////////////////
bool tc::Task::is_waiting () const
{
return tc_task_is_waiting (&*inner);
}
////////////////////////////////////////////////////////////////////////////////
bool tc::Task::is_active () const
{
return tc_task_is_active (&*inner);
}
////////////////////////////////////////////////////////////////////////////////
bool tc::Task::is_blocked () const
{
return tc_task_is_blocked (&*inner);
}
////////////////////////////////////////////////////////////////////////////////
bool tc::Task::is_blocking () const
{
return tc_task_is_blocking (&*inner);
}
////////////////////////////////////////////////////////////////////////////////
std::string tc::Task::task_error () const {
TCString error = tc_task_error (&*inner);

View file

@ -79,8 +79,10 @@ namespace tc {
// TODO: time_t tc_task_get_entry(struct TCTask *task);
// TODO: time_t tc_task_get_wait(struct TCTask *task);
// TODO: time_t tc_task_get_modified(struct TCTask *task);
// TODO: bool tc_task_is_waiting(struct TCTask *task);
// TODO: bool tc_task_is_active(struct TCTask *task);
bool is_waiting() const;
bool is_active() const;
bool is_blocked() const;
bool is_blocking() const;
// TODO: bool tc_task_has_tag(struct TCTask *task, struct TCString tag);
// TODO: struct TCStringList tc_task_get_tags(struct TCTask *task);
// TODO: struct TCAnnotationList tc_task_get_annotations(struct TCTask *task);