X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Futil.h;h=85d79108218b35feee7a3a62a7dcb8d30f792c96;hp=632ba0e6d8aa2d9121634d20eb11ab50e6cba57c;hb=8f1b4ca33d65b7d9b0e5be399dbff13c9591fbce;hpb=cd4f987d0d8ace10272bf1d87c788b741a9e85e8 diff --git a/src/common/util.h b/src/common/util.h index 632ba0e6..85d79108 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -79,3 +79,17 @@ QByteArray prettyDigest(const QByteArray &digest); * @return String with current date/time substituted in via formatting codes */ QString formatCurrentDateTimeInString(const QString &formatStr); + +/** Check if a scope rule matches a string + * + * Checks that the string does NOT match ANY inverted rules (prefixed by '!'), then checks that + * it matches AT LEAST one normal (non-inverted) rule. + * + * If only inverted rules are specified, it'll match so long as the string does not match any + * inverted rules (implicit wildcard). + * + * @param scopeRule A ';'-separated list of wildcard expressions, prefix of '!' inverts subrule + * @param string String to test, e.g. network/channel name + * @return True if matches, otherwise false + */ +bool scopeMatch(const QString &scopeRule, const QString &string);