Enhanced export command

- Now sanitizes output by replacing ' with " in descriptions.
- Added 'recur' attribute to exported output.
- Removed recurring, deleted and complete tasks from the export.
This commit is contained in:
Paul Beckingham
2009-03-14 13:36:32 -04:00
parent 8ac3978222
commit 5383943fa7
3 changed files with 24 additions and 5 deletions

View File

@@ -328,6 +328,11 @@ const std::string T::composeCSV ()
line += value;
line += ",";
value = mAttributes["recur"];
if (value != "")
line += value;
line += ",";
value = mAttributes["end"];
if (value != "")
line += value;
@@ -353,7 +358,11 @@ const std::string T::composeCSV ()
line += "'" + value + "'";
line += ",";
line += "'" + mDescription + "'\n";
// Convert single quotes to double quotes, because single quotes are used to
// delimit the values that need it.
std::string clean = mDescription;
std::replace (clean.begin (), clean.end (), '\'', '"');
line += "'" + clean + "'\n";
return line;
}