LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
SearchPathPlusRelative.cxx
Go to the documentation of this file.
2 
3 #include "cetlib/search_path.h"
4 
5 std::string lar::searchPathPlusRelative(std::string relativePath, std::string fileName)
6 {
7  // Add a final directory separator ("/") to relPath if not already there.
8  if (!relativePath.empty() && (relativePath.back() != '/')) relativePath += '/';
9 
10  relativePath += std::move(fileName);
11 
12  // Search all reasonable locations for the file; we see if by any chance FW_SEARCH_PATH
13  // directory is set and try there.
14  cet::search_path const sp("FW_SEARCH_PATH");
15  return sp.find_file(relativePath);
16 }
std::string searchPathPlusRelative(std::string relativePath, std::string fileName)