15 <<
" for reading condition "
16 "database password\n";
21 while (
f.good() && !
found) {
25 if (
line[0] ==
'#' ||
line.empty()) {
35 if (!
found && nstatements == 1) {
41 if (
line.find_first_of(
": \t") == string::npos) {
48 throw cms::Exception(
"Database") <<
" Password for condition database user '" <<
user <<
"' not found in"
49 <<
" password file " <<
fileName <<
"\n";
55 size_t len =
s.size();
57 while (pos0 <
s.size() &&
find(delim.begin(), delim.end(),
s[pos0]) != delim.end()) {
60 if (pos0 >= len || pos0 == string::npos)
62 pos =
s.find_first_of(delim, pos0);
63 return s.substr(pos0, (
pos > 0 ?
pos :
s.size()) - pos0);
68 if (pos0 == std::string::npos) {
72 if (pos1 == std::string::npos) {
75 return s.substr(pos0, pos1 - pos0);