summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-06-27 04:49:25 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2022-07-11 13:14:01 (GMT)
commitc67b82c998d92db285ebfe5870435a0d231cb149 (patch)
treea7e2abf39fa679429a0c780e31060904e6c61f8f /Source/cmFindPackageCommand.cxx
parentf71b88c4c16b5379bf45cc11a2cd0eb04ad7f080 (diff)
downloadCMake-c67b82c998d92db285ebfe5870435a0d231cb149.zip
CMake-c67b82c998d92db285ebfe5870435a0d231cb149.tar.gz
CMake-c67b82c998d92db285ebfe5870435a0d231cb149.tar.bz2
cmFindPackageCommand: Enclose file list generators into anonymous ns
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx49
1 files changed, 27 insertions, 22 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 99c4b4e..55f699b 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -54,7 +54,6 @@
#endif
class cmExecutionStatus;
-class cmFileList;
namespace {
@@ -2147,6 +2146,9 @@ void cmFindPackageCommand::StoreVersionFound()
}
}
+namespace {
+class cmFileList;
+
class cmFileListGeneratorBase
{
public:
@@ -2188,27 +2190,6 @@ private:
cmFileListGeneratorBase* Last = nullptr;
};
-class cmFindPackageFileList : public cmFileList
-{
-public:
- cmFindPackageFileList(cmFindPackageCommand* fpc, bool use_suffixes = true)
- : FPC(fpc)
- , UseSuffixes(use_suffixes)
- {
- }
-
-private:
- bool Visit(std::string const& fullPath) override
- {
- if (this->UseSuffixes) {
- return this->FPC->SearchDirectory(fullPath);
- }
- return this->FPC->CheckDirectory(fullPath);
- }
- cmFindPackageCommand* FPC;
- bool UseSuffixes;
-};
-
bool cmFileListGeneratorBase::Search(cmFileList& listing)
{
return this->Search(std::string{}, listing);
@@ -2240,7 +2221,30 @@ bool cmFileListGeneratorBase::IsIgnoredEntry(const char* const fname)
return fname[0] == '.' &&
(fname[1] == 0 || (fname[1] == '.' && fname[2] == 0));
}
+} // anonymous namespace
+
+class cmFindPackageFileList : public cmFileList
+{
+public:
+ cmFindPackageFileList(cmFindPackageCommand* fpc, bool use_suffixes = true)
+ : FPC(fpc)
+ , UseSuffixes(use_suffixes)
+ {
+ }
+
+private:
+ bool Visit(std::string const& fullPath) override
+ {
+ if (this->UseSuffixes) {
+ return this->FPC->SearchDirectory(fullPath);
+ }
+ return this->FPC->CheckDirectory(fullPath);
+ }
+ cmFindPackageCommand* FPC;
+ bool UseSuffixes;
+};
+namespace {
class cmFileListGeneratorFixed : public cmFileListGeneratorBase
{
public:
@@ -2492,6 +2496,7 @@ private:
return cm::make_unique<cmFileListGeneratorGlob>(*this);
}
};
+} // anonymous namespace
bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
{