8 std::string
comment, std::string sentry )
9 : myDelimiter(delimiter), myComment(comment), mySentry(sentry)
13 std::ifstream
in( filename.c_str() );
22 : myDelimiter( std::string(1,
'=') ), myComment( std::string(1,
'#') )
48 static const char whitespace[] =
" \n\t\v\r\f";
49 s.erase( 0, s.find_first_not_of(whitespace) );
50 s.erase( s.find_last_not_of(whitespace) + 1U );
62 os <<
p->second << std::endl;
75 const std::string& sentry = cf.
mySentry;
76 const pos
skip = delim.length();
80 while( is || nextline.length() > 0 )
84 if( nextline.length() > 0 )
91 std::getline( is, line );
95 line = line.substr( 0, line.find(comm) );
98 if( sentry !=
"" && line.find(sentry) != std::string::npos )
return is;
101 pos delimPos = line.find( delim );
102 if( delimPos < std::string::npos )
105 string key = line.substr( 0, delimPos );
106 line.replace( 0, delimPos+skip,
"" );
111 bool terminate =
false;
112 while( !terminate && is )
114 std::getline( is, nextline );
117 string nlcopy = nextline;
119 if( nlcopy ==
"" )
continue;
121 nextline = nextline.substr( 0, nextline.find(comm) );
122 if( nextline.find(delim) != std::string::npos )
124 if( sentry !=
"" && nextline.find(sentry) != std::string::npos )
129 if( nlcopy !=
"" ) line +=
"\n";
static void trim(std::string &s)
std::map< std::string, std::string > myContents
void remove(const std::string &key)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
bool keyExists(const std::string &key) const
std::map< std::string, std::string >::const_iterator mapci
std::istream & operator>>(std::istream &input, CLHEP::HepGenMatrix &matrix)