45void trim(std::string& line,
const std::string& trimChars)
48 if(line.length() == 0) {
51 std::size_t found = line.find_first_not_of(trimChars);
52 if(found != std::string::npos) {
53 line = line.substr(found, line.length());
55 found = line.find_last_not_of(trimChars);
56 if(found != std::string::npos) {
57 line = line.substr(0, found + 1);
64 line.erase(line.begin(), std::find_if(line.begin(), line.end(), [](
int ch) { return std::isspace(ch) == 0; }));
65 line.erase(std::find_if(line.rbegin(), line.rend(), [](
int ch) { return std::isspace(ch) == 0; }).base(), line.end());
70 if(fileName.length() == 0) {
73 std::size_t found = fileName.rfind(
".root");
74 if(found == std::string::npos) {
77 std::size_t found2 = fileName.rfind(
'-');
79 if(found2 == std::string::npos) {
80 found2 = fileName.rfind(
'_');
83 if(found2 == std::string::npos || fileName.compare(found2 + 4, 5,
".root") != 0) {
84 temp = fileName.substr(found - 5, 5);
86 temp = fileName.substr(found - 9, 5);
88 return atoi(temp.c_str());
93 if(fileName.length() == 0) {
97 std::size_t found = fileName.rfind(
'-');
98 if(found != std::string::npos) {
99 std::string temp = fileName.substr(found + 1, 3);
100 return atoi(temp.c_str());
102 found = fileName.rfind(
'_');
103 if(found != std::string::npos) {
104 std::string temp = fileName.substr(found + 1, 3);
105 return atoi(temp.c_str());