make TDB2.undo non-public

The stats command calls an API to provide this information in a way that
will still be relevant for TaskChampion, while CmdInfo's access to the
data remains.  The TaskChampion interface for per-task hitsory is still
not ready.
This commit is contained in:
Dustin J. Mitchell
2022-04-01 22:15:55 +00:00
committed by Tomas Babej
parent 2f30bc8cbf
commit 4ebd0ffb39
4 changed files with 33 additions and 25 deletions

View File

@@ -1266,6 +1266,13 @@ int TDB2::num_local_changes ()
return std::count_if(lines.begin(), lines.end(), [](const auto& line){ return line.front() == '{'; });
}
////////////////////////////////////////////////////////////////////////////////
int TDB2::num_reverts_possible ()
{
std::vector <std::string> lines = undo.get_lines ();
return std::count(lines.begin(), lines.end(), "---");
}
////////////////////////////////////////////////////////////////////////////////
size_t TDB2::data_size ()
{