X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fexpressionmatch.h;h=a22b34bfd577353e0aa0b4b2d1f5d87f01263f45;hb=80950b87640acfb2a75902f8aabf3419da094bf4;hp=0f5acfcfb3f1b5cadc8c330293e1924608c898ae;hpb=09906ed00eb2ba2fa1cc0f5464f166e5a85a2c92;p=quassel.git diff --git a/src/common/expressionmatch.h b/src/common/expressionmatch.h index 0f5acfcf..a22b34bf 100644 --- a/src/common/expressionmatch.h +++ b/src/common/expressionmatch.h @@ -20,28 +20,21 @@ #pragma once -#include -#include +#include "common-export.h" -#if QT_VERSION >= 0x050000 #include -#else -#include -#endif +#include +#include /** * Expression matcher with multiple modes of operation and automatic caching for performance */ -class ExpressionMatch +class COMMON_EXPORT ExpressionMatch { public: /// Expression matching mode -#if QT_VERSION >= 0x050000 enum class MatchMode { -#else - enum MatchMode { -#endif MatchPhrase, ///< Match phrase as specified, no special handling MatchMultiPhrase, ///< Match phrase as specified, split on \n only MatchWildcard, ///< Match wildcards, "!" at start inverts, "\" escapes @@ -189,13 +182,9 @@ private: * * @param regExString Regular expression string * @param caseSensitive If true, match case-sensitively, otherwise ignore case when matching - * @return Configured QRegExp class on Qt 4, QRegularExpression on Qt 5 + * @return Configured QRegularExpression */ -#if QT_VERSION >= 0x050000 static QRegularExpression regExFactory(const QString ®ExString, bool caseSensitive); -#else - static QRegExp regExFactory(const QString ®ExString, bool caseSensitive); -#endif /** * Escapes any regular expression characters in a string so they have no special meaning @@ -244,18 +233,10 @@ private: bool _sourceExpressionEmpty = false; ///< Cached expression match string is empty /// Underlying regular expression matching instance for normal (noninverted) rules -#if QT_VERSION >= 0x050000 QRegularExpression _matchRegEx = {}; -#else - QRegExp _matchRegEx = {}; -#endif bool _matchRegExActive = false; ///< If true, use normal expression in matching /// Underlying regular expression matching instance for inverted rules -#if QT_VERSION >= 0x050000 QRegularExpression _matchInvertRegEx = {}; -#else - QRegExp _matchInvertRegEx = {}; -#endif bool _matchInvertRegExActive = false; ///< If true, use invert expression in matching };