#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... | |
IO::IO | ( | const char * | filepattern | ) |
builds IO from files matching filepattern
Definition at line 10 of file IO.cc.
References gather_cfg::cout, PatBasicFWLiteAnalyzer::files, pftools::Utils::Glob(), mps_fire::i, and ParseFile().
|
inline |
Definition at line 53 of file IO.h.
References gather_cfg::cout, Dump(), operator<<, and MillePedeFileConverter_cfg::out.
void IO::Dump | ( | std::ostream & | out = std::cout | ) | const |
dumps fAllLines
Definition at line 77 of file IO.cc.
References fAllLines, and mps_fire::i.
Referenced by operator<<(), and ~IO().
bool pftools::IO::GetAllOpt | ( | const char * | tag, |
const char * | key, | ||
std::vector< T > & | values | ||
) |
bool pftools::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 138 of file IO.h.
References data, GetNextLineData(), recoMuon::in, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.
string IO::GetLineData | ( | const char * | tag, |
const char * | key | ||
) | const |
Definition at line 90 of file IO.cc.
References data, fAllLines, plotBeamSpotDB::first, runEdmFileComparison::found, mps_fire::i, recoMuon::in, edm::second(), sLinesize, AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.
Referenced by GetNextLineData(), GetOpt(), and IsZombie().
string IO::GetNextLineData | ( | const char * | tag, |
const char * | key | ||
) |
Definition at line 115 of file IO.cc.
References data, fAllLines, fCurkey, fCurline, fCurtag, plotBeamSpotDB::first, runEdmFileComparison::found, GetLineData(), GetOpt(), mps_fire::i, recoMuon::in, crabWrapper::key, edm::second(), sLinesize, AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.
Referenced by GetAllOpt(), and IsZombie().
bool pftools::IO::GetOpt | ( | const char * | tag, |
const char * | key, | ||
std::vector< T > & | values | ||
) | const |
reads a vector of T
Definition at line 108 of file IO.h.
References data, GetLineData(), recoMuon::in, AlCaHLTBitMon_QueryRunRegistry::string, and tmp.
Referenced by pftools::CalibCompare::CalibCompare(), pftools::Exercises3::calibrateCalibratables(), pftools::Exercises3::evaluateCalibrator(), pftools::Exercises3::evaluateSpaceManager(), pftools::Exercises3::Exercises3(), GetNextLineData(), and IsZombie().
bool pftools::IO::GetOpt | ( | const char * | tag, |
const char * | key, | ||
T & | value | ||
) | const |
reads a T
Definition at line 123 of file IO.h.
References data, GetLineData(), recoMuon::in, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.
bool pftools::IO::GetOpt | ( | const char * | tag, |
const char * | key, | ||
std::string & | value | ||
) | const |
reads a string
|
inline |
true if constructor went wrong
Definition at line 62 of file IO.h.
References GetAllOpt(), GetLineData(), GetNextLineData(), GetOpt(), crabWrapper::key, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, and MuonErrorMatrixValues_cff::values.
|
private |
parse one file
Definition at line 32 of file IO.cc.
References gather_cfg::cout, data, relativeConstraints::empty, fAllLines, recoMuon::in, alignCSCRings::s, sLinesize, and GlobalPosition_Frontier_DevDB_cff::tag.
Referenced by IO().
|
friend |
dumps fAllLines
Referenced by ~IO().
|
private |
all non empty, uncommented lines
Definition at line 32 of file IO.h.
Referenced by Dump(), GetLineData(), GetNextLineData(), and ParseFile().
|
private |
|
private |
|
private |
|
static |
maximum line size
Definition at line 49 of file IO.h.
Referenced by GetLineData(), GetNextLineData(), and ParseFile().