\class cmSearchPath * \brief Container for encapsulating a set of search paths * * cmSearchPath is a container that encapsulates search path construction and * management */
| 18 | * management |
| 19 | */ |
| 20 | class cmSearchPath |
| 21 | { |
| 22 | public: |
| 23 | // cmSearchPath must be initialized from a valid pointer. The only reason |
| 24 | // for the default is to allow it to be easily used in stl containers. |
| 25 | // Attempting to initialize with a NULL value will fail an assertion |
| 26 | cmSearchPath(cmFindCommon* findCmd = nullptr); |
| 27 | ~cmSearchPath(); |
| 28 | |
| 29 | cmSearchPath(cmSearchPath const&) = default; |
| 30 | cmSearchPath& operator=(cmSearchPath const&) = default; |
| 31 | |
| 32 | struct PathWithPrefix |
| 33 | { |
| 34 | std::string Path; |
| 35 | std::string Prefix; |
| 36 | |
| 37 | bool operator<(PathWithPrefix const& other) const |
| 38 | { |
| 39 | return this->Path < other.Path || |
| 40 | (this->Path == other.Path && this->Prefix < other.Prefix); |
| 41 | } |
| 42 | }; |
| 43 | std::vector<PathWithPrefix> const& GetPaths() const { return this->Paths; } |
| 44 | std::size_t size() const { return this->Paths.size(); } |
| 45 | |
| 46 | void ExtractWithout(std::set<std::string> const& ignorePaths, |
| 47 | std::set<std::string> const& ignorePrefixes, |
| 48 | std::vector<std::string>& outPaths) const; |
| 49 | |
| 50 | void AddPath(std::string const& path); |
| 51 | void AddUserPath(std::string const& path); |
| 52 | void AddCMakePath(std::string const& variable); |
| 53 | void AddEnvPath(std::string const& variable); |
| 54 | void AddCMakePrefixPath(std::string const& variable); |
| 55 | void AddEnvPrefixPath(std::string const& variable, bool stripBin = false); |
| 56 | void AddSuffixes(std::vector<std::string> const& suffixes); |
| 57 | void AddPrefixPaths(std::vector<std::string> const& paths); |
| 58 | |
| 59 | protected: |
| 60 | void AddPathInternal(std::string const& path, std::string const& prefix); |
| 61 | |
| 62 | cmFindCommon* FC; |
| 63 | std::vector<PathWithPrefix> Paths; |
| 64 | }; |
no outgoing calls
no test coverage detected
searching dependent graphs…