1 #ifndef EUDAQ_INCLUDED_FileNamer
2 #define EUDAQ_INCLUDED_FileNamer
12 FileNamer(
const std::string &pattern =
"");
13 FileNamer &SetReplace(
char opt,
const std::string &val);
14 template <
typename T>
FileNamer &Set(
char opt,
const T &val);
15 operator std::string()
const;
16 static const std::string default_pattern;
20 part_t(
char n,
int l = 0) : name(n), len(l) {}
21 part_t(
const std::string &s) : name(0), len(0), str(s) {}
26 std::vector<part_t> m_parts;
29 template <
typename T>
FileNamer &FileNamer::Set(
char opt,
const T &val) {
30 for (
size_t i = 0; i < m_parts.size(); ++i) {
31 if (m_parts[i].name == opt) {
32 m_parts[i].str =
to_string(val, m_parts[i].len);
39 #endif // EUDAQ_INCLUDED_FileNamer
Definition: FileNamer.hh:10
std::string to_string(const T &x, int digits=0)
Definition: Utils.hh:54