Elements  5.12
A C++ base framework for the Euclid Software.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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/Path.h" // for Path::Item
33 #include "ElementsKernel/Export.h" // ELEMENTS_API
34 
35 namespace Elements {
36 
37 enum class SearchType {
39 };
40 
59 template <typename T>
61  const std::string& searched_name,
62  T directory,
63  SearchType search_type);
64 
65 // template instantiations of the most common types
66 extern template
68  Path::Item directory,
69  SearchType search_type);
70 extern template
72  std::string directory,
73  SearchType search_type);
74 
75 
95  const std::string& file_name,
96  const std::string& path_like_env_variable,
97  SearchType search_type = SearchType::Recursive);
98 
99 } // namespace Elements
100 
101 #define ELEMENTSKERNEL_ELEMENTSKERNEL_PATHSEARCH_IMPL_
103 #undef ELEMENTSKERNEL_ELEMENTSKERNEL_PATHSEARCH_IMPL_
104 
105 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_PATHSEARCH_H_
106 
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.Recursive) and in that case more than one results can be return.
STL class.
defines the macros to be used for explicit export of the symbols
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...
Definition: PathSearch.cpp:68
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
boost::filesystem::path Item
Definition: Path.h:61
STL class.
provide functions to retrieve resources pointed by environment variables