forked from qt-creator/qt-creator
FeatureSet: Add some helper methods
I used to reimplement these a couple of times already. Change-Id: I265cf50bf976638b4ac5406ae4010cf33c20354c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user