|
ATLAS Offline Software
|
Go to the documentation of this file.
21 #ifndef READCARDS_READCARDS_H
22 #define READCARDS_READCARDS_H
37 using std::ostringstream;
69 std::vector<double> dValues;
80 else return string(
"");
109 std::vector<int>
a;
a.reserve(
s.size());
110 for (
size_t i=0 ;
i<
s.size() ;
i++ )
a.push_back(
int(
s[
i]) );
143 for (
unsigned i=
v.size() ;
i-- ; )
value[
i] =
v[
i];
147 void Set(
const std::string&
tag, std::vector<std::string>&
value)
const {
155 std::vector<string>
tags;
198 cerr <<
"ReadCards::GetValue() no tag: " <<
tag <<
" in file: " <<
m_FileName << endl;
206 cerr <<
"ReadCards::addTag() tag " <<
tag <<
" already defined in file " <<
m_FileName << endl;
241 cerr <<
"ReadCards() syntax error in file " <<
m_FileName <<
" : " <<
s << endl;
246 double handle(
const std::string&
s,
const std::string& =
"")
const {
248 char temps[1024] =
"";
250 if ( (
r = std::sscanf(
s.c_str(),
"%lf%1023s", &
d, temps))==0 ||
r!=1 ||
string(temps)!=
"" ) {
251 cerr <<
"ReadCards() error converting string to number : " <<
s << endl;
string parseleft(string &s)
void declareProperty(const std::string &key, std::vector< T > &t)
std::string find(const std::string &s)
return a remapped string
double GetValue(int i) const
const std::vector< double > GetVector(unsigned i) const
string GetValueString(unsigned i) const
bool AddTag(const string &tag, const vector< string > &values)
void parse()
parse the remaining cleaned input string
void Set(const string &tag, double &value) const
vector< string > parseright(string &s)
void Set(const std::string &tag, std::string &value) const
static std::vector< std::string > m_Path
std::vector< std::string > tags
std::string GetString(const std::string &tag) const
Get tag-value pairs from a file.
void clean()
remove comments and whitespace
std::vector< string > Tags(const std::string &pattern="") const
void declareProperty(const std::string &key, std::vector< std::string > &t)
void error(const std::string &s)
std::string GetString(const unsigned i) const
void Set(const string &tag, std::vector< double > &value) const
void Set(const std::string &tag, std::vector< std::string > &value) const
std::vector< int > m_ValuesFlag
std::vector< Value > m_Values
std::vector< std::string > GetStringVector(const std::string &tag) const
bool isTagDefined(const string &tag) const
double handle(const std::string &s, const std::string &="") const
ReadCards(const std::string &filename)
const std::vector< int > GetIntVector(const std::string &tag) const
double GetValue(const string &tag) const
void Set(const string &tag, int &value) const
void declareProperty(const std::string &key, T &t)
int GetIndex(const std::string &tag) const
void Set(const string &tag, std::vector< int > &value) const
void Construct(const std::string &filename)
check for file in cwd or if not, check in the RESPLOTDIR, then read the file
const std::vector< double > GetVector(const std::string &tag) const
void declareProperty(const std::string &key, std::string &t)