mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 15:47:19 +02:00
TDB2
- Added TDB2::clear and TF2::clear methods.
This commit is contained in:
parent
8ec130d3c0
commit
0f627bd44e
3 changed files with 42 additions and 0 deletions
34
src/TDB2.cpp
34
src/TDB2.cpp
|
@ -368,6 +368,27 @@ int TF2::id (const std::string& uuid)
|
|||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TF2::clear ()
|
||||
{
|
||||
_read_only = false;
|
||||
_dirty = false;
|
||||
_loaded_tasks = false;
|
||||
_loaded_lines = false;
|
||||
_loaded_contents = false;
|
||||
|
||||
_contents = "";
|
||||
_file._data = "";
|
||||
|
||||
_tasks.clear ();
|
||||
_added_tasks.clear ();
|
||||
_modified_tasks.clear ();
|
||||
_lines.clear ();
|
||||
_added_lines.clear ();
|
||||
_I2U.clear ();
|
||||
_U2I.clear ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// <label> <rw><dirty> <tasks> <lines> <contents>
|
||||
//
|
||||
|
@ -709,6 +730,19 @@ bool TDB2::verifyUniqueUUID (const std::string& uuid)
|
|||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TDB2::clear ()
|
||||
{
|
||||
pending.clear ();
|
||||
completed.clear ();
|
||||
undo.clear ();
|
||||
backlog.clear ();
|
||||
synch_key.clear ();
|
||||
|
||||
_location = "";
|
||||
_id = 1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TDB2::dump ()
|
||||
{
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
std::string uuid (int);
|
||||
int id (const std::string&);
|
||||
|
||||
void clear ();
|
||||
const std::string dump ();
|
||||
|
||||
public:
|
||||
|
@ -104,6 +105,7 @@ public:
|
|||
bool get (const std::string&, Task&);
|
||||
const std::vector <Task> siblings (Task&);
|
||||
|
||||
void clear ();
|
||||
void dump ();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue