mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-27 21:15:19 +00:00
32 lines
472 B
C++
32 lines
472 B
C++
#include "IPathMatcher.h"
|
|
#include <SeparatorPrefixTree.h>
|
|
#include <QRegularExpression>
|
|
|
|
class MultiMatcher : public IPathMatcher
|
|
{
|
|
public:
|
|
virtual ~MultiMatcher() {};
|
|
MultiMatcher()
|
|
{
|
|
}
|
|
MultiMatcher &add(Ptr add)
|
|
{
|
|
m_matchers.append(add);
|
|
return *this;
|
|
}
|
|
|
|
virtual bool matches(const QString &string) const override
|
|
{
|
|
for(auto iter: m_matchers)
|
|
{
|
|
if(iter->matches(string))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
QList<Ptr> m_matchers;
|
|
};
|