63 std::string
find_file(
const std::string& base_name,
64 const std::vector<std::string>& search_dirs)
const;
75 std::string
find_file(
const std::string& base_name,
76 const std::string& search_path
88 const std::vector<std::string>& search_dirs)
const;
99 const std::string& search_path
121 static bool dir_iterate(
const std::string& dir_name,
122 const std::function<
bool(
const std::string&,
const std::string&)>& func);
Singleton class that handles file searches.
Definition: FileManager.hh:25
std::string marley_dir() const
Returns the path to the root MARLEY folder.
Definition: FileManager.hh:103
std::string marley_dir_
Stores the value of the MARLEY environment variable (which points to the root folder of the source co...
Definition: FileManager.hh:129
FileManager()
Create the singleton FileManager object.
Definition: FileManager.cc:52
std::vector< std::string > list_all_files(const std::vector< std::string > &search_dirs) const
Get a vector of full paths for all regular files in the requested directories.
Definition: FileManager.cc:146
FileManager(FileManager &&)=delete
Deleted move constructor.
static std::string default_search_path_
By default, use this search path when looking for files.
Definition: FileManager.hh:125
FileManager(const FileManager &)=delete
Deleted copy constructor.
static std::vector< std::string > search_path_to_dir_vector(const std::string &search_path=FileManager::default_search_path_)
Converts a ':'-delimited search path (given as a single string) into a vector of directory names.
Definition: FileManager.cc:87
static bool dir_iterate(const std::string &dir_name, const std::function< bool(const std::string &, const std::string &)> &func)
Helper function that executes a std::function on the name of each regular file found while scanning t...
Definition: FileManager.cc:173
FileManager & operator=(FileManager &&)=delete
Deleted move assignment operator.
static const FileManager & Instance()
Get a const reference to the singleton instance of the FileManager.
Definition: FileManager.cc:76
FileManager & operator=(const FileManager &)=delete
Deleted copy assignment operator.
std::string find_file(const std::string &base_name, const std::vector< std::string > &search_dirs) const
Searches for a file in the given directories.
Definition: FileManager.cc:102