// // Created by Tobias Hieta on 20/08/15. // #ifndef KONVERGO_CACHEDREGEXMATCHER_H #define KONVERGO_CACHEDREGEXMATCHER_H #include #include #include #include typedef QPair MatcherValuePair; typedef QList MatcherValueList; class CachedRegexMatcher : public QObject { public: CachedRegexMatcher(QObject* parent = 0) : QObject(parent) {} bool addMatcher(const QString& pattern, const QVariant& result); QVariant match(const QString& input); void clear(); private: MatcherValueList m_matcherList; QHash m_matcherCache; }; #endif //KONVERGO_CACHEDREGEXMATCHER_H