- T object support status "r"

This commit is contained in:
Paul Beckingham 2008-06-27 00:24:39 -04:00
parent 6066cc3bab
commit 647cbab3f4
3 changed files with 6 additions and 4 deletions

View file

@ -21,7 +21,7 @@ Test Suite
regression tests for every bug, command, feature regression tests for every bug, command, feature
Recurrence Recurrence
- new T::status recurring (stored as R) + new T::status recurring (stored as R)
- new user-specifiable attributes - recur:<duration> [until:<date>] - new user-specifiable attributes - recur:<duration> [until:<date>]
- duration: - duration:
daily, day, 1d daily, day, 1d

View file

@ -247,7 +247,7 @@ void T::setSubstitution (const std::string& from, const std::string& to)
// uuid status [tags] [attributes] description // uuid status [tags] [attributes] description
// //
// uuid \x{8}-\x{4}-\x{4}-\x{4}-\x{12} // uuid \x{8}-\x{4}-\x{4}-\x{4}-\x{12}
// status - O X // status - + X r
// tags \w+ \s ... // tags \w+ \s ...
// attributes \w+:\w+ \s ... // attributes \w+:\w+ \s ...
// description .+ // description .+
@ -261,6 +261,7 @@ const std::string T::compose () const
if (mStatus == pending) line += "- ["; if (mStatus == pending) line += "- [";
else if (mStatus == completed) line += "+ ["; else if (mStatus == completed) line += "+ [";
else if (mStatus == deleted) line += "X ["; else if (mStatus == deleted) line += "X [";
else if (mStatus == recurring) line += "r [";
// Tags // Tags
for (size_t i = 0; i < mTags.size (); ++i) for (size_t i = 0; i < mTags.size (); ++i)
@ -303,6 +304,7 @@ const std::string T::composeCSV ()
if (mStatus == pending) line += "'pending',"; if (mStatus == pending) line += "'pending',";
else if (mStatus == completed) line += "'completed',"; else if (mStatus == completed) line += "'completed',";
else if (mStatus == deleted) line += "'deleted',"; else if (mStatus == deleted) line += "'deleted',";
else if (mStatus == recurring) line += "'recurring',";
// Tags // Tags
line += "'"; line += "'";
@ -499,7 +501,7 @@ int T::determineVersion (const std::string& line)
line[18] == '-' && line[18] == '-' &&
line[23] == '-' && line[23] == '-' &&
line[36] == ' ' && line[36] == ' ' &&
(line[37] == '-' || line[37] == '+' || line[37] == 'X')) (line[37] == '-' || line[37] == '+' || line[37] == 'X' || line[37] == 'r'))
return 2; return 2;
// Version 3? // Version 3?

View file

@ -37,7 +37,7 @@
class T class T
{ {
public: public:
enum status {pending, completed, deleted}; enum status {pending, completed, deleted, recurring};
T (); // Default constructor T (); // Default constructor
T (const std::string&); // Initialize by parsing storage format T (const std::string&); // Initialize by parsing storage format