Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
Framework
IO
detail
validateFileNamePattern.cc
Go to the documentation of this file.
1
#include "
art/Framework/IO/detail/validateFileNamePattern.h
"
2
#include "
canvas/Utilities/Exception.h
"
3
4
#include <regex>
5
6
void
7
art::detail::validateFileNamePattern
(
bool
const
do_check,
8
std::string
const
&
pattern
)
9
{
10
if
(!do_check)
11
return
;
12
13
if
(std::regex_search(pattern, std::regex(
"%(\\d*)#"
))) {
14
return
;
15
}
16
17
throw
Exception
{
errors::Configuration
}
18
<<
"If you have specified the 'fileProperties' table in your "
19
"configuration,\n"
20
<<
"then the file pattern '%#' MUST be present in the file name. For "
21
"example:\n"
22
<<
" "
<< pattern.substr(0, pattern.find(
".root"
)) <<
"_%#.root\n"
23
<<
"is a supported file name. Please change your file name to include "
24
"the '%#' pattern."
;
25
}
string
std::string string
Definition:
nybbler.cc:12
art::detail::validateFileNamePattern
void validateFileNamePattern(bool do_check, std::string const &pattern)
Definition:
validateFileNamePattern.cc:7
Exception.h
art::errors::Configuration
Definition:
Exception.h:32
validateFileNamePattern.h
art::Exception
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition:
Exception.h:66
pattern
std::string pattern
Definition:
regex_t.cc:35
Generated by
1.8.11