BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
PathResolver.h
Go to the documentation of this file.
1#ifndef __PathResolver_h__
2#define __PathResolver_h__
3
4#include <string>
5
7public:
9
11
12 /**
13
14 @arg @c logical_file_name the name of the file to locate in the search path
15 @arg @c search_path the name of a path-like environment variable
16 @arg @c search_type characterizes the type of search. Can be either @c LocalSearch or @c
17 RecursiveSearch
18
19 @return the physical name of the located file or empty string if not found
20
21 */
22 static std::string find_file( const std::string& logical_file_name,
23 const std::string& search_path,
24 SearchType search_type = LocalSearch );
25
26 /**
27
28 @arg @c logical_file_name the name of the file to locate in the search path
29 @arg @c search_list the prioritized list of possible locations separated by the usual path
30 separator
31 @arg @c search_type characterizes the type of search. Can be either @c LocalSearch or @c
32 RecursiveSearch
33
34 @return the physical name of the located file or empty string if not found
35
36 */
37 static std::string find_file_from_list( const std::string& logical_file_name,
38 const std::string& search_list,
39 SearchType search_type = LocalSearch );
40
41 /**
42
43 @arg @c logical_file_name the name of the directory to locate in the search path
44 @arg @c search_path the name of a path-like environment variable
45 @arg @c search_type characterizes the type of search. Can be either LocalSearch or
46 RecursiveSearch
47
48 @return the physical name of the located directory or empty string if not found
49
50 */
51 static std::string find_directory( const std::string& logical_file_name,
52 const std::string& search_path,
53 SearchType search_type = LocalSearch );
54
55 /**
56
57 @arg @c logical_file_name the name of the directory to locate in the search path
58 @arg @c search_list the prioritized list of possible locations separated by the usual path
59 separator
60 @arg @c search_type characterizes the type of search. Can be either LocalSearch or
61 RecursiveSearch
62
63 @return the physical name of the located directory or empty string if not found
64
65 */
66 static std::string find_directory_from_list( const std::string& logical_file_name,
67 const std::string& search_list,
68 SearchType search_type = LocalSearch );
69
70 /**
71
72 @arg @c search_path the name of a path-like environment variable
73
74 @return the result of the verification. Can be one of @c Ok, @c EnvironmentVariableUndefined,
75 @c UnknownDirectory
76
77 */
78 static SearchPathStatus check_search_path( const std::string& search_path );
79};
80
81extern "C" {
82PathResolver::SearchPathStatus PathResolverCheckSearchPath( const std::string& search_path );
83std::string PathResolverFindDirectory( const std::string& logical_file_name,
84 const std::string& search_path );
85std::string PathResolverFindDirectoryFromList( const std::string& logical_file_name,
86 const std::string& search_list );
87std::string PathResolverFindFile( const std::string& logical_file_name,
88 const std::string& search_path );
89std::string PathResolverFindFileFromList( const std::string& logical_file_name,
90 const std::string& search_list );
91std::string PathResolverFindXMLFile( const std::string& logical_file_name );
92std::string PathResolverFindDataFile( const std::string& logical_file_name );
93}
94
95#endif
std::string PathResolverFindDirectory(const std::string &logical_file_name, const std::string &search_path)
std::string PathResolverFindFile(const std::string &logical_file_name, const std::string &search_path)
std::string PathResolverFindDirectoryFromList(const std::string &logical_file_name, const std::string &search_list)
std::string PathResolverFindXMLFile(const std::string &logical_file_name)
std::string PathResolverFindFileFromList(const std::string &logical_file_name, const std::string &search_list)
std::string PathResolverFindDataFile(const std::string &logical_file_name)
PathResolver::SearchPathStatus PathResolverCheckSearchPath(const std::string &search_path)
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
static std::string find_directory(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
static std::string find_directory_from_list(const std::string &logical_file_name, const std::string &search_list, SearchType search_type=LocalSearch)
@ EnvironmentVariableUndefined
Definition PathResolver.h:8
static std::string find_file_from_list(const std::string &logical_file_name, const std::string &search_list, SearchType search_type=LocalSearch)
static SearchPathStatus check_search_path(const std::string &search_path)