From f5b09df9c88d49c95fd0c0ef7b3670b40634ca5c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 27 May 2022 09:50:35 +0200 Subject: WIP: automatic externals --- src/search.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/search.h (limited to 'src/search.h') 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 +#include +#include + +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& 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& haystack); + + +std::vector findBasename(const Settings& settings, + const std::string& needle, + const std::vector& haystack); + +std::vector findLibrary(const Settings& settings, + const std::string& needle, + const std::vector& haystack); -- cgit v1.2.3