diff options
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); |