Elements 6.3.1
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
PathSearch.h
Go to the documentation of this file.
1
26#ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_PATHSEARCH_H_
27#define ELEMENTSKERNEL_ELEMENTSKERNEL_PATHSEARCH_H_
28
29#include <string>
30#include <vector>
31
32#include "ElementsKernel/Export.h" // ELEMENTS_API
33#include "ElementsKernel/Path.h" // for Path::Item
34
35namespace Elements {
36inline namespace Kernel {
37
38enum class SearchType { Local, Recursive };
39
58template <typename T>
59ELEMENTS_API std::vector<T> pathSearch(const std::string& searched_name, T directory, SearchType search_type);
60
61// template instantiations of the most common types
62extern template ELEMENTS_API std::vector<Path::Item> pathSearch(const std::string& searched_name, Path::Item directory,
63 SearchType search_type);
64extern template ELEMENTS_API std::vector<std::string> pathSearch(const std::string& searched_name,
65 std::string directory, SearchType search_type);
66
85std::vector<Path::Item> pathSearchInEnvVariable(const std::string& file_name, const std::string& path_like_env_variable,
86 SearchType search_type = SearchType::Recursive);
87} // namespace Kernel
88} // namespace Elements
89
90#define ELEMENTSKERNEL_ELEMENTSKERNEL_PATHSEARCH_IMPL_
91#include "ElementsKernel/_impl/PathSearch.tpp" // IWYU pragma: export
92#undef ELEMENTSKERNEL_ELEMENTSKERNEL_PATHSEARCH_IMPL_
93
94#endif // ELEMENTSKERNEL_ELEMENTSKERNEL_PATHSEARCH_H_
95
defines the macros to be used for explicit export of the symbols
implementation of the templates declared in ElementsKernel/Path.h
provide functions to retrieve resources pointed by environment variables
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition Export.h:74
ELEMENTS_API std::vector< T > pathSearch(const std::string &searched_name, T directory, SearchType search_type)
Searches for a file or a directory in a directory. The search can be recursive (SearchType....
boost::filesystem::path Item
Definition Path.h:57
ELEMENTS_API std::vector< Path::Item > pathSearchInEnvVariable(const std::string &file_name, const std::string &path_like_env_variable, SearchType search_type=SearchType::Recursive)
Searches for a file or a directory in a path pointed by an environment variable. It can contains coll...