Refactor task diffs to handle new attributes

This refactors task(Info)Differences to be methods of Task and to
correctly handle the `annotation_`, `tags_`, and `dep_` attributes.
This commit is contained in:
Dustin J. Mitchell
2021-08-29 04:08:13 +00:00
committed by Tomas Babej
parent 7aee9567a3
commit 309e99d49e
14 changed files with 269 additions and 223 deletions

View File

@@ -165,6 +165,9 @@ public:
void modify (modType, bool text_required = false);
#endif
std::string diff (const Task& after) const;
std::string diffForInfo (const Task& after, const std::string& dateformat, long& last_timestamp, const long current_timestamp) const;
private:
int determineVersion (const std::string&);
void parseJSON (const std::string&);
@@ -179,6 +182,7 @@ private:
bool isDepAttr (const std::string&) const;
const std::string dep2Attr (const std::string&) const;
const std::string attr2Dep (const std::string&) const;
bool isAnnotationAttr (const std::string&) const;
void fixDependsAttribute ();
void fixTagsAttribute ();