MultiMC5/launcher/pathmatcher/MultiMatcher.h

32 lines
580 B
C
Raw Normal View History

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