Task: Make isTag/Dep/AnnotationAttr methods static

This allows usage of these helper methods outside of Task class.
This commit is contained in:
Tomas Babej 2021-10-16 10:08:29 -04:00
parent 3dbad09f72
commit 339a4ddb51
2 changed files with 7 additions and 6 deletions

View file

@ -1478,7 +1478,7 @@ void Task::fixTagsAttribute ()
}
////////////////////////////////////////////////////////////////////////////////
bool Task::isTagAttr(const std::string& attr) const
bool Task::isTagAttr(const std::string& attr)
{
return attr.compare(0, 5, "tags_") == 0;
}
@ -1512,7 +1512,7 @@ void Task::fixDependsAttribute ()
}
////////////////////////////////////////////////////////////////////////////////
bool Task::isDepAttr(const std::string& attr) const
bool Task::isDepAttr(const std::string& attr)
{
return attr.compare(0, 4, "dep_") == 0;
}
@ -1533,7 +1533,7 @@ const std::string Task::attr2Dep (const std::string& attr) const
}
////////////////////////////////////////////////////////////////////////////////
bool Task::isAnnotationAttr(const std::string& attr) const
bool Task::isAnnotationAttr(const std::string& attr)
{
return attr.compare(0, 11, "annotation_") == 0;
}

View file

@ -113,6 +113,10 @@ public:
bool is_overdue () const;
bool is_udaPresent () const;
bool is_orphanPresent () const;
static bool isTagAttr (const std::string&);
static bool isDepAttr (const std::string&);
static bool isAnnotationAttr (const std::string&);
#endif
bool is_waiting () const;
@ -176,13 +180,10 @@ private:
void validate_before (const std::string&, const std::string&);
const std::string encode (const std::string&) const;
const std::string decode (const std::string&) const;
bool isTagAttr (const std::string&) const;
const std::string tag2Attr (const std::string&) const;
const std::string attr2Tag (const std::string&) const;
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 ();