2015-08-18 05:55:24 +05:30
|
|
|
#include "IPathMatcher.h"
|
|
|
|
#include <SeparatorPrefixTree.h>
|
|
|
|
#include <QRegularExpression>
|
|
|
|
|
|
|
|
class MultiMatcher : public IPathMatcher
|
|
|
|
{
|
|
|
|
public:
|
2018-07-15 18:21:05 +05:30
|
|
|
virtual ~MultiMatcher() {};
|
|
|
|
MultiMatcher()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
MultiMatcher &add(Ptr add)
|
|
|
|
{
|
|
|
|
m_matchers.append(add);
|
|
|
|
return *this;
|
|
|
|
}
|
2015-08-18 05:55:24 +05:30
|
|
|
|
2018-07-15 18:21:05 +05:30
|
|
|
virtual bool matches(const QString &string) const override
|
|
|
|
{
|
|
|
|
for(auto iter: m_matchers)
|
|
|
|
{
|
|
|
|
if(iter->matches(string))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2015-08-18 05:55:24 +05:30
|
|
|
|
2018-07-15 18:21:05 +05:30
|
|
|
QList<Ptr> m_matchers;
|
2015-08-18 05:55:24 +05:30
|
|
|
};
|