mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 16:15:43 +00:00
Add vector parameter functions to and/or matchers
This commit is contained in:
parent
69c08def7f
commit
38551f29de
@ -90,11 +90,21 @@ public:
|
|||||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherAnd<TokenType>>(matchers));
|
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherAnd<TokenType>>(matchers));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_NODISCARD MatcherFactoryWrapper<TokenType> And(std::vector<std::unique_ptr<AbstractMatcher<TokenType>>> matchers) const
|
||||||
|
{
|
||||||
|
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherAnd<TokenType>>(std::move(matchers)));
|
||||||
|
}
|
||||||
|
|
||||||
_NODISCARD MatcherFactoryWrapper<TokenType> Or(std::initializer_list<Movable<std::unique_ptr<AbstractMatcher<TokenType>>>> matchers) const
|
_NODISCARD MatcherFactoryWrapper<TokenType> Or(std::initializer_list<Movable<std::unique_ptr<AbstractMatcher<TokenType>>>> matchers) const
|
||||||
{
|
{
|
||||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherOr<TokenType>>(matchers));
|
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherOr<TokenType>>(matchers));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_NODISCARD MatcherFactoryWrapper<TokenType> Or(std::vector<std::unique_ptr<AbstractMatcher<TokenType>>> matchers) const
|
||||||
|
{
|
||||||
|
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherOr<TokenType>>(std::move(matchers)));
|
||||||
|
}
|
||||||
|
|
||||||
_NODISCARD MatcherFactoryWrapper<TokenType> Loop(std::unique_ptr<AbstractMatcher<TokenType>> matcher) const
|
_NODISCARD MatcherFactoryWrapper<TokenType> Loop(std::unique_ptr<AbstractMatcher<TokenType>> matcher) const
|
||||||
{
|
{
|
||||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherLoop<TokenType>>(std::move(matcher)));
|
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherLoop<TokenType>>(std::move(matcher)));
|
||||||
|
@ -37,4 +37,9 @@ public:
|
|||||||
: m_matchers(std::make_move_iterator(matchers.begin()), std::make_move_iterator(matchers.end()))
|
: m_matchers(std::make_move_iterator(matchers.begin()), std::make_move_iterator(matchers.end()))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
explicit MatcherAnd(std::vector<std::unique_ptr<AbstractMatcher<TokenType>>> matchers)
|
||||||
|
: m_matchers(std::move(matchers))
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -35,4 +35,9 @@ public:
|
|||||||
: m_matchers(std::make_move_iterator(matchers.begin()), std::make_move_iterator(matchers.end()))
|
: m_matchers(std::make_move_iterator(matchers.begin()), std::make_move_iterator(matchers.end()))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
explicit MatcherOr(std::vector<std::unique_ptr<AbstractMatcher<TokenType>>> matchers)
|
||||||
|
: m_matchers(std::move(matchers))
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user