summaryrefslogtreecommitdiffstats
path: root/logic/pathmatcher/MultiMatcher.h
blob: 91f70aa43f0847c25a4a05cf133571a3d87ba99f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#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;
};