General option file parser. More...
#include <IO.h>
Public Member Functions | |
void | Dump (std::ostream &out=std::cout) const |
dumps fAllLines More... | |
template<class T > | |
bool | GetAllOpt (const char *tag, const char *key, std::vector< T > &values) |
reads a vector of T More... | |
template<class T > | |
bool | GetAllOpt (const char *tag, const char *key, T &value) |
reads a T More... | |
std::string | GetLineData (const char *tag, const char *key) const |
std::string | GetNextLineData (const char *tag, const char *key) |
template<class T > | |
bool | GetOpt (const char *tag, const char *key, std::vector< T > &values) const |
reads a vector of T More... | |
template<class T > | |
bool | GetOpt (const char *tag, const char *key, T &value) const |
reads a T More... | |
bool | GetOpt (const char *tag, const char *key, std::string &value) const |
reads a string More... | |
IO (const char *filepattern) | |
builds IO from files matching filepattern More... | |
bool | IsZombie () const |
true if constructor went wrong More... | |
~IO () | |
Static Public Attributes | |
static const unsigned | sLinesize = 1000 |
maximum line size More... | |
Private Member Functions | |
bool | ParseFile (const char *filename) |
parse one file More... | |
Private Attributes | |
std::vector< std::pair < std::string, std::string > > | fAllLines |
all non empty, uncommented lines More... | |
std::string | fCurkey |
current key More... | |
int | fCurline |
counter More... | |
std::string | fCurtag |
current tag More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, IO &io) |
dumps fAllLines More... | |
General option file parser.
IO::IO | ( | const char * | filepattern | ) |
builds IO from files matching filepattern
Definition at line 9 of file IO.cc.
References gather_cfg::cout, linker::files, Utils::Glob(), i, and ParseFile().
|
inline |
void IO::Dump | ( | std::ostream & | out = std::cout | ) | const |
dumps fAllLines
Definition at line 76 of file IO.cc.
Referenced by operator<<().
bool IO::GetAllOpt | ( | const char * | tag, |
const char * | key, | ||
std::vector< T > & | values | ||
) |
bool IO::GetAllOpt | ( | const char * | tag, |
const char * | key, | ||
T & | value | ||
) |
reads a T
this function allows to read several lines with the same tag/key:
Definition at line 136 of file IO.h.
References runTheMatrix::data, GetNextLineData(), recoMuon::in, and relativeConstraints::value.
string IO::GetLineData | ( | const char * | tag, |
const char * | key | ||
) | const |
Definition at line 89 of file IO.cc.
References runTheMatrix::data, fAllLines, first, newFWLiteAna::found, i, recoMuon::in, edm::second(), sLinesize, and GlobalPosition_Frontier_DevDB_cff::tag.
Referenced by GetOpt().
string IO::GetNextLineData | ( | const char * | tag, |
const char * | key | ||
) |
Definition at line 114 of file IO.cc.
References runTheMatrix::data, fAllLines, fCurkey, fCurline, fCurtag, first, newFWLiteAna::found, i, recoMuon::in, combine::key, edm::second(), sLinesize, and GlobalPosition_Frontier_DevDB_cff::tag.
Referenced by GetAllOpt().
bool IO::GetOpt | ( | const char * | tag, |
const char * | key, | ||
std::vector< T > & | values | ||
) | const |
reads a vector of T
Definition at line 106 of file IO.h.
References runTheMatrix::data, GetLineData(), recoMuon::in, and tmp.
Referenced by PFRootEventManager::connect(), DisplayManager::readOptions(), PFRootEventManager::readOptions(), and PFRootEventManagerColin::readSpecificOptions().
bool IO::GetOpt | ( | const char * | tag, |
const char * | key, | ||
T & | value | ||
) | const |
reads a T
Definition at line 121 of file IO.h.
References runTheMatrix::data, GetLineData(), recoMuon::in, and relativeConstraints::value.
bool IO::GetOpt | ( | const char * | tag, |
const char * | key, | ||
std::string & | value | ||
) | const |
reads a string
|
inline |
|
private |
parse one file
Definition at line 31 of file IO.cc.
References gather_cfg::cout, runTheMatrix::data, relativeConstraints::empty, fAllLines, recoMuon::in, pos, asciidump::s, sLinesize, and GlobalPosition_Frontier_DevDB_cff::tag.
Referenced by IO().
|
friend |
dumps fAllLines
|
private |
all non empty, uncommented lines
Definition at line 31 of file IO.h.
Referenced by Dump(), GetLineData(), GetNextLineData(), IsZombie(), ParseFile(), and ~IO().
|
private |
|
private |
|
private |
|
static |
maximum line size
Definition at line 48 of file IO.h.
Referenced by GetLineData(), GetNextLineData(), and ParseFile().