- Added TDB2::clear and TF2::clear methods.
This commit is contained in:
Paul Beckingham
2011-08-28 08:13:41 -04:00
parent 8ec130d3c0
commit 0f627bd44e
3 changed files with 42 additions and 0 deletions

View File

@@ -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 ()
{