mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Issue #15 Added CVariant::matches()
If the contained object type has a matches() method, CVariant::matches() will call that method and return its result. (This is a utility to allow using CVariant to represent an event subscription.)
This commit is contained in:
@@ -36,4 +36,9 @@ namespace BlackMisc
|
||||
QMetaType::registerConverter<CVariantList, QVector<CVariant>>([](const CVariantList &list) { return list.toVector(); });
|
||||
QMetaType::registerConverter<QVector<CVariant>, CVariantList>([](const QVector<CVariant> &list) { return CSequence(list); });
|
||||
}
|
||||
|
||||
bool CVariantList::matches(const CVariant &event) const
|
||||
{
|
||||
return containsBy([ & ](const CVariant &pattern) { return pattern.matches(event); });
|
||||
}
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user