#include <fstream>
#include <cctype>
#include <vector>
#include <stdexcept>
#include <string>
Go to the source code of this file.
|
template<typename T > |
std::vector< T > & | details::appendToVector (std::vector< T > &dest, std::vector< T > const &src) |
|
template<typename StartIter , typename EndIter > |
StartIter | details::skipSpaces (StartIter begin, EndIter end) |
|
bool | isROOTfile (std::string const &filePath) |
| Returns whether the specified path represents a file list. More...
|
|
std::vector< std::string > | expandFileList (std::string const &listPath) |
| Expands the content of a file list into a vector of file paths (recursive). More...
|
|
std::vector< std::string > | expandInputFiles (std::vector< std::string > const &filePaths) |
| Expands all input files into a vector of file paths. More...
|
|
#define HAS_STD_FILESYSTEM 0 |
std::vector<std::string> expandFileList |
( |
std::string const & |
listPath | ) |
|
|
inline |
Expands the content of a file list into a vector of file paths (recursive).
Definition at line 96 of file sbndcode/sbndcode/gallery/helpers/expandInputFiles.h.
98 std::ifstream
list(listPath);
101 std::vector<std::string> files;
103 unsigned int iLine = 0;
106 std::getline(
list, line);
109 auto const end = line.cend();
115 if (i ==
end)
continue;
116 if (*i ==
'#')
continue;
118 std::string filePath;
122 filePath.append(iChunk, i); iChunk = i;
123 if (++i ==
end)
break;
124 if ((*i ==
'\\') || (*i ==
'#')) iChunk = i;
127 else if (std::isspace(*i)) {
128 filePath.append(iChunk, i); iChunk = i;
130 if (iAfter ==
end)
break;
131 if (*iAfter ==
'#')
break;
137 filePath.append(iChunk, i);
138 if (filePath.empty())
continue;
141 files.push_back(filePath);
auto end(FixedBins< T, C > const &) noexcept
std::vector< T > & appendToVector(std::vector< T > &dest, std::vector< T > const &src)
StartIter skipSpaces(StartIter begin, EndIter end)
std::vector<std::string> expandInputFiles |
( |
std::vector< std::string > const & |
filePaths | ) |
|
|
inline |
Expands all input files into a vector of file paths.
Definition at line 158 of file sbndcode/sbndcode/gallery/helpers/expandInputFiles.h.
160 std::vector<std::string> expanded;
161 for (std::string
const&
path: filePaths) {
163 expanded.push_back(
path);
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
std::vector< T > & appendToVector(std::vector< T > &dest, std::vector< T > const &src)
bool isROOTfile |
( |
std::string const & |
filePath | ) |
|
|
inline |
Returns whether the specified path represents a file list.
Definition at line 80 of file sbndcode/sbndcode/gallery/helpers/expandInputFiles.h.
81 if (filePath.length() < 6)
return false;
83 auto iExt = filePath.rfind(
'.');
84 if (iExt == std::string::npos)
return false;
86 auto iBaseName = filePath.rfind(
'/');
87 if ((iBaseName != std::string::npos) && (iBaseName > iExt))
90 return filePath.substr(iExt) ==
".root";