diff options
Diffstat (limited to 'Source/cmSearchPath.h')
-rw-r--r-- | Source/cmSearchPath.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h index c15cb97..4c0cabb 100644 --- a/Source/cmSearchPath.h +++ b/Source/cmSearchPath.h @@ -26,10 +26,25 @@ public: cmSearchPath(cmFindCommon* findCmd = nullptr); ~cmSearchPath(); - const std::vector<std::string>& GetPaths() const { return this->Paths; } + cmSearchPath(const cmSearchPath&) = default; + cmSearchPath& operator=(const cmSearchPath&) = default; + + struct PathWithPrefix + { + std::string Path; + std::string Prefix; + + bool operator<(const PathWithPrefix& other) const + { + return this->Path < other.Path || + (this->Path == other.Path && this->Prefix < other.Prefix); + } + }; + const std::vector<PathWithPrefix>& GetPaths() const { return this->Paths; } std::size_t size() const { return this->Paths.size(); } - void ExtractWithout(const std::set<std::string>& ignore, + void ExtractWithout(const std::set<std::string>& ignorePaths, + const std::set<std::string>& ignorePrefixes, std::vector<std::string>& outPaths, bool clear = false) const; @@ -44,8 +59,9 @@ public: const char* base = nullptr); protected: - void AddPathInternal(const std::string& path, const char* base = nullptr); + void AddPathInternal(const std::string& path, const std::string& prefix, + const char* base = nullptr); cmFindCommon* FC; - std::vector<std::string> Paths; + std::vector<PathWithPrefix> Paths; }; |