43 IO(
const string aFilePattern);
60 void Dump(ostream& out = cout)
const;
79 bool GetOpt(
const char* aTag,
const char* aKey, vector< T >& aValues)
const;
90 bool GetOpt(
const char* aTag,
const char* aKey, T& aValue)
const;
100 bool GetOpt(
const char* aTag,
const char* aKey,
string& aValue)
const;
108 string GetLineData(
const char* aTag,
const char* aKey)
const;
119 bool GetAllOpt(
const char* aTag,
const char* aKey, vector< T >& aValues);
129 bool GetAllOpt(
const char* aTag,
const char* aKey, T& aValue);
151bool IO::GetOpt(
const char* tag,
const char* key, vector< T >& values)
const {
154 istringstream in(data.c_str());
159 values.push_back(tmp);
162 return (
bool)values.size();
166bool IO::GetOpt(
const char* tag,
const char* key, T& value)
const {
169 istringstream in(data.c_str());
171 return (!!in)&&data.size();
182 if(!data.compare(
""))
break;
183 istringstream inval(data.c_str());
187 values.push_back(tmp);
192 return (
bool)values.size();
198 if(data.empty())
return false;
200 istringstream in(data.c_str());
This module offers C++ utility functions.
Parse option files.
Definition IO.h:19
string GetLineData(const char *aTag, const char *aKey) const
Returns the option line defined by a tag and a keyword.
Definition IO.cc:73
string fCurtag
current tag
Definition IO.h:146
bool ParseFile(const char *filename)
parse one file
Definition IO.cc:17
bool GetOpt(const char *aTag, const char *aKey, vector< T > &aValues) const
Gets an option vector.
Definition IO.h:151
bool IsZombie(void) const
Flags the parsing sequence.
Definition IO.h:66
bool GetAllOpt(const char *aTag, const char *aKey, vector< T > &aValues)
Gets a vector of all options.
Definition IO.h:175
string GetNextLineData(const char *aTag, const char *aKey)
Returns the next option line defined by a tag and a keyword.
Definition IO.cc:102
string fCurkey
current key
Definition IO.h:145
int fCurline
line counter
Definition IO.h:144
void Dump(ostream &out=cout) const
Dumps all options.
Definition IO.cc:61
static const unsigned sLinesize
maximum number of characters in a line
Definition IO.h:147
vector< pair< string, string > > fAllLines
option lines
Definition IO.h:142
virtual ~IO(void)
Destructor of the IO class.
Definition IO.h:48
friend ostream & operator<<(ostream &out, IO &io)
Definition IO.cc:66