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);
std::vector< std::string > tokenize(std::string line, char delimiter)
std::string trim(const std::string &s, const std::string &chars) const
static void trim(std::string &s)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
ROOT::VecOps::RVec< UChar_t > chars
std::string tokenize(const std::string &s, const std::string &delim, size_t &pos) const
void readPassword(const std::string &fileName, const std::string &user, std::string &password)