diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 1c3286300..786cdcef9 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -1642,6 +1642,19 @@ int TDB2::next_id () return _id++; } +//////////////////////////////////////////////////////////////////////////////// +const std::vector TDB2::all_tasks () +{ + std::vector all = pending.get_tasks (); + std::vector extra = completed.get_tasks (); + + std::vector ::iterator task; + for (task = extra.begin (); task != extra.end (); ++task) + all.push_back (*task); + + return all; +} + //////////////////////////////////////////////////////////////////////////////// // Locate task by ID. bool TDB2::get (int id, Task& task) diff --git a/src/TDB2.h b/src/TDB2.h index 8d75e9618..b6f23a1e1 100644 --- a/src/TDB2.h +++ b/src/TDB2.h @@ -103,6 +103,7 @@ public: int next_id (); // Generalized task accessors. + const std::vector all_tasks (); bool get (int, Task&); bool get (const std::string&, Task&); const std::vector siblings (Task&);