mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Merge pull request #10205 from 9999years/final-matchers
Make `Matcher` subclasses `final`
This commit is contained in:
commit
bff5c94184
1 changed files with 5 additions and 4 deletions
|
@ -481,11 +481,12 @@ struct CmdProfileInstall : InstallablesCommand, MixDefaultProfile
|
||||||
|
|
||||||
struct Matcher
|
struct Matcher
|
||||||
{
|
{
|
||||||
|
virtual ~Matcher() { }
|
||||||
virtual std::string getTitle() = 0;
|
virtual std::string getTitle() = 0;
|
||||||
virtual bool matches(const std::string & name, const ProfileElement & element) = 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::regex regex;
|
||||||
std::string pattern;
|
std::string pattern;
|
||||||
|
@ -504,7 +505,7 @@ struct RegexMatcher : public Matcher
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct StorePathMatcher : public Matcher
|
struct StorePathMatcher final : public Matcher
|
||||||
{
|
{
|
||||||
nix::StorePath storePath;
|
nix::StorePath storePath;
|
||||||
|
|
||||||
|
@ -522,7 +523,7 @@ struct StorePathMatcher : public Matcher
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NameMatcher : public Matcher
|
struct NameMatcher final : public Matcher
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
|
@ -540,7 +541,7 @@ struct NameMatcher : public Matcher
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AllMatcher : public Matcher
|
struct AllMatcher final : public Matcher
|
||||||
{
|
{
|
||||||
std::string getTitle() override
|
std::string getTitle() override
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue