Commit f130c3c7 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

FeatureSet: Add some helper methods



I used to reimplement these a couple of times already.

Change-Id: I265cf50bf976638b4ac5406ae4010cf33c20354c
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 6a52868c
......@@ -77,6 +77,11 @@ public:
return *this;
}
bool isEmpty() const
{
return QSet<Feature>::isEmpty();
}
bool contains(const Feature &feature) const
{
return QSet<Feature>::contains(feature);
......@@ -92,6 +97,11 @@ public:
QSet<Feature>::remove(feature);
}
void remove(const FeatureSet &features)
{
QSet<Feature>::subtract(features);
}
FeatureSet operator|(const Feature &feature) const
{
FeatureSet copy = *this;
......@@ -129,6 +139,14 @@ public:
stringList.append(feature.toString());
return stringList;
}
static FeatureSet fromStringList(const QStringList &list)
{
FeatureSet features;
foreach (const QString &i, list)
features |= Feature(Id::fromString(i));
return features;
}
};
} // namespace Core
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment