22#include <fmt/format.h>
30std::vector<std::string>
listFiles(std::string
const& dir, std::string
const& searchpattern)
32 std::vector<std::string> filenames;
33 std::string rs = searchpattern.empty() ?
".*" : searchpattern;
34 std::regex str_expr(rs);
36 for (
auto& p : std::filesystem::directory_iterator(dir)) {
38 if (!p.is_directory()) {
39 auto fn = p.path().filename().string();
40 if (regex_match(fn, str_expr)) {
41 filenames.push_back(p.path().string());
53std::vector<std::string>
listFiles(std::string
const& searchpattern)
60 if (!
path.empty() && !std::filesystem::create_directories(
path) && !std::filesystem::is_directory(
path)) {
61 throw std::runtime_error(fmt::format(
"Failed to create {} directory",
path));
71 std::regex
e(R
"(\$\{?[a-zA-Z0-9_]*\}?)");
72 std::regex e3("[a-zA-Z0-9_]+");
74 std::sregex_iterator iter;
75 auto words_end = std::sregex_iterator();
76 auto words_begin = std::sregex_iterator(input.begin(), input.end(),
e);
79 if (words_end == words_begin) {
84 for (
auto i = words_begin;
i != words_end; ++
i) {
88 std::string
s(
match.str());
90 if (std::regex_search(
s,
m, e3)) {
91 auto envlookup = getenv(
m[0].
str().c_str());
93 finalstr +=
match.prefix().str() + std::string(envlookup);
96 finalstr +=
match.prefix().str() +
"${" +
m[0].str().c_str() +
"}";
98 tail =
match.suffix().str();
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
bool match(const std::vector< std::string > &queries, const char *pattern)
GLsizei const GLchar *const * path
std::vector< std::string > listFiles(std::string const &dir, std::string const &searchpattern)
void createDirectoriesIfAbsent(std::string const &path)
std::string expandShellVarsInFileName(std::string const &input)