14 ifstream
f(fileName.c_str());
17 <<
"Failed to open file " << fileName <<
" for reading condition " 18 "database password\n";
27 if(line[0]==
'#' || line.empty()){
31 string u =
tokenize(line,
":/ \t", pos);
33 password =
tokenize(line,
":/ \t", pos);
37 if(!found && nstatements==1){
43 if(line.find_first_of(
": \t")==string::npos){
51 <<
" Password for condition database user '" << user <<
"' not found in" 52 <<
" password file " << fileName <<
"\n";
60 size_t len = s.size();
62 while(pos0<s.size() &&
find(delim.begin(), delim.end(), s[pos0])!=delim.end()){
65 if(pos0>=len || pos0==string::npos)
return "";
66 pos = s.find_first_of(delim, pos0);
67 return s.substr(pos0, (pos>0?pos:s.size())-pos0);
73 if(pos0==std::string::npos){
77 if(pos1==std::string::npos){
80 return s.substr(pos0, pos1-pos0);
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void readPassword(const std::string &fileName, const std::string &user, std::string &password)
std::string tokenize(const std::string &s, const std::string &delim, size_t &pos) const
std::string trim(const std::string &s, const std::string &chars) const
std::vector< std::string > tokenize(std::string const &input, std::string const &separator)
breaks the input string into tokens, delimited by the separator