From 468d04ef1444360cc95f685783bab9dc0e7ac43a Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Mon, 4 Jul 2022 06:11:46 +0400 Subject: cmFindPackageCommand: Move methods implementation into the class definition --- Source/cmFindPackageCommand.cxx | 43 +++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 068fbf8..afc63a5 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -2157,14 +2157,27 @@ public: protected: bool Consider(std::string const& fullPath, cmFileList& listing); - static bool IsIgnoredEntry(const char* fname); + static bool IsIgnoredEntry(const char* fname) + { + assert(fname != nullptr); + assert(fname[0] != 0); + return fname[0] == '.' && + (fname[1] == 0 || (fname[1] == '.' && fname[2] == 0)); + } private: - bool Search(cmFileList&); - virtual bool Search(std::string const& parent, cmFileList&) = 0; - virtual std::unique_ptr Clone() const = 0; friend class cmFileList; - cmFileListGeneratorBase* SetNext(cmFileListGeneratorBase const& next); + virtual std::unique_ptr Clone() const = 0; + virtual bool Search(std::string const& parent, cmFileList&) = 0; + bool Search(cmFileList& listing) + { + return this->Search(std::string{}, listing); + } + cmFileListGeneratorBase* SetNext(cmFileListGeneratorBase const& next) + { + this->Next = next.Clone(); + return this->Next.get(); + } std::unique_ptr Next; }; @@ -2191,18 +2204,6 @@ private: cmFileListGeneratorBase* Last = nullptr; }; -bool cmFileListGeneratorBase::Search(cmFileList& listing) -{ - return this->Search(std::string{}, listing); -} - -cmFileListGeneratorBase* cmFileListGeneratorBase::SetNext( - cmFileListGeneratorBase const& next) -{ - this->Next = next.Clone(); - return this->Next.get(); -} - bool cmFileListGeneratorBase::Consider(std::string const& fullPath, cmFileList& listing) { @@ -2214,14 +2215,6 @@ bool cmFileListGeneratorBase::Consider(std::string const& fullPath, } return listing.Visit(fullPath + '/'); } - -bool cmFileListGeneratorBase::IsIgnoredEntry(const char* const fname) -{ - assert(fname != nullptr); - assert(fname[0] != 0); - return fname[0] == '.' && - (fname[1] == 0 || (fname[1] == '.' && fname[2] == 0)); -} } // anonymous namespace class cmFindPackageFileList : public cmFileList -- cgit v0.12