Merge pull request #10205 from 9999years/final-matchers

Make `Matcher` subclasses `final`
This commit is contained in:
Eelco Dolstra 2024-03-12 07:23:15 +01:00 committed by GitHub
commit bff5c94184
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -481,11 +481,12 @@ struct CmdProfileInstall : InstallablesCommand, MixDefaultProfile
struct Matcher
{
virtual ~Matcher() { }
virtual std::string getTitle() = 0;
virtual bool matches(const std::string & name, const ProfileElement & element) = 0;
};
struct RegexMatcher : public Matcher
struct RegexMatcher final : public Matcher
{
std::regex regex;
std::string pattern;
@ -504,7 +505,7 @@ struct RegexMatcher : public Matcher
}
};
struct StorePathMatcher : public Matcher
struct StorePathMatcher final : public Matcher
{
nix::StorePath storePath;
@ -522,7 +523,7 @@ struct StorePathMatcher : public Matcher
}
};
struct NameMatcher : public Matcher
struct NameMatcher final : public Matcher
{
std::string name;
@ -540,7 +541,7 @@ struct NameMatcher : public Matcher
}
};
struct AllMatcher : public Matcher
struct AllMatcher final : public Matcher
{
std::string getTitle() override
{