diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-05-27 09:50:35 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-06-09 22:29:32 +0200 |
commit | f5b09df9c88d49c95fd0c0ef7b3670b40634ca5c (patch) | |
tree | 3b5e78254b88e5546bf8e041226ad90db1d512c2 /src/search.h | |
parent | 7a16146600384272baf7fb2fc0fc64f59b17ffe9 (diff) |
WIP: automatic externalsexternals
Diffstat (limited to 'src/search.h')
-rw-r--r-- | src/search.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/search.h b/src/search.h new file mode 100644 index 0000000..1841978 --- /dev/null +++ b/src/search.h @@ -0,0 +1,37 @@ +// -*- c++ -*- +// Distributed under the BSD 2-Clause License. +// See accompanying file LICENSE for details. +#pragma once + +#include <filesystem> +#include <string> +#include <vector> + +struct Settings; + +//! Locate file (needle) in the provided search path list (haystack) +//! The provided settings is used to control verbosity during the search. +//! \returns a std::filesystem::path pointing to path in which file was found +//! - empty if not found. +std::filesystem::path findFile(const Settings& settings, + const std::string& needle, + const std::vector<std::string>& haystack); + +//! Locate header (needle) in the provided search path list (haystack) +//! The provided settings is used to control verbosity during the search as well +//! as providing the search paths defaults for headers. +//! The argument provided haystack is prepended to the one supplied by settings. +//! \returns a std::filesystem::path pointing to path where the file was found +//! - empty if not found. +std::filesystem::path findHeader(const Settings& settings, + const std::string& needle, + const std::vector<std::string>& haystack); + + +std::vector<std::filesystem::path> findBasename(const Settings& settings, + const std::string& needle, + const std::vector<std::string>& haystack); + +std::vector<std::filesystem::path> findLibrary(const Settings& settings, + const std::string& needle, + const std::vector<std::string>& haystack); |