76 #include <QTextStream>
77 #include <QStringList>
82 template <
typename VectorT >
86 const QString & _section,
87 const QString & _key )
const
89 SectionMap::const_iterator sIter;
90 EntryMap::const_iterator eIter;
97 if( (eIter = sIter->second.find( _key )) == sIter->second.end() )
100 QStringList list = eIter->second.split(
';',QString::SkipEmptyParts);
106 if ( list.size() != dim ) {
107 std::cerr <<
"Differet size when reading Vector" << std::endl;
112 for (
int i = 0 ; i < dim; ++i) {
114 _val[i] = (
typename VectorT::value_type) list[i].toInt(&tmpOk);
124 template <
typename VectorT >
128 const QString & _section,
129 const QString & _key )
const
131 SectionMap::const_iterator sIter;
132 EntryMap::const_iterator eIter;
139 if( (eIter = sIter->second.find( _key )) == sIter->second.end() )
142 QStringList list = eIter->second.split(
';',QString::SkipEmptyParts);
148 if ( list.size() != dim ) {
149 std::cerr <<
"Differet size when reading Vector" << std::endl;
154 for (
int i = 0 ; i < dim; ++i) {
156 _val[i] = (
typename VectorT::value_type) list[i].toDouble(&tmpOk);
166 template <
typename VectorT >
170 const QString & _section,
171 const QString & _key )
const
173 SectionMap::const_iterator sIter;
174 EntryMap::const_iterator eIter;
181 if( (eIter = sIter->second.find( _key )) == sIter->second.end() )
184 QStringList list = eIter->second.split(
';',QString::SkipEmptyParts);
190 if ( list.size() != dim ) {
191 std::cerr <<
"Differet size when reading Vector" << std::endl;
196 for (
int i = 0 ; i < dim; ++i) {
198 _val[i] = (
typename VectorT::value_type) list[i].toFloat(&tmpOk);
208 template <
typename VectorT >
212 const QString & _key,
221 for (
int j = 0; j < dim; ++j)
222 list += QString::number( _value[j] ) +
";";
229 template <
typename VectorT >
233 const QString & _section,
234 const QString & _key )
const
236 SectionMap::const_iterator sIter;
237 EntryMap::const_iterator eIter;
246 if( (eIter = sIter->second.find( _key )) == sIter->second.end() )
249 QStringList list = eIter->second.split(
';',QString::SkipEmptyParts);
256 for (
int i = 0 ; i < list.size(); )
258 if ( list[i].isEmpty() )
262 std::vector<double> tmp;
264 for (
int j = 0; j < dim; ++j)
267 tmp.push_back( list[i].toDouble(&tmpOk) );
272 for (
int j = 0; j < dim; ++j)
273 vec[j] = (
typename VectorT::value_type)(tmp[j]);
285 template <
typename VectorT >
289 const QString & _section,
290 const QString & _key )
const
292 SectionMap::const_iterator sIter;
293 EntryMap::const_iterator eIter;
302 if( (eIter = sIter->second.find( _key )) == sIter->second.end() )
305 QStringList list = eIter->second.split(
';',QString::SkipEmptyParts);
312 for (
int i = 0 ; i < list.size(); )
314 if ( list[i].isEmpty() )
318 std::vector<double> tmp;
320 for (
int j = 0; j < dim; ++j)
323 tmp.push_back( list[i].toFloat(&tmpOk) );
328 for (
int j = 0; j < dim; ++j)
329 vec[j] = (
typename VectorT::value_type)(tmp[j]);
341 template <
typename VectorT >
345 const QString & _section,
346 const QString & _key )
const
348 SectionMap::const_iterator sIter;
349 EntryMap::const_iterator eIter;
358 if( (eIter = sIter->second.find( _key )) == sIter->second.end() )
361 QStringList list = eIter->second.split(
';',QString::SkipEmptyParts);
368 for (
int i = 0 ; i < list.size(); )
370 if ( list[i].isEmpty() )
374 std::vector<double> tmp;
376 for (
int j = 0; j < dim; ++j)
379 tmp.push_back( list[i].toInt(&tmpOk) );
384 for (
int j = 0; j < dim; ++j)
385 vec[j] = (
typename VectorT::value_type)(tmp[j]);
398 template <
typename VectorT >
402 const QString & _key,
403 const std::vector< VectorT > & _value)
406 typename std::vector< VectorT >::const_iterator viter;
410 for(viter = _value.begin();viter!=_value.end();++viter)
412 for (
int i = 0; i < tmp.dim(); ++i)
413 list += QString::number( (*viter)[i] ) +
";";
void add_entryVec(const QString &_section, const QString &_key, const VectorT &_value)
Addition of a Vec_n_something.
bool get_entryVeci(VectorT &_val, const QString &_section, const QString &_key) const
Get a Vec_n_i (int)
bool get_entryVecd(VectorT &_val, const QString &_section, const QString &_key) const
Get a Vec_n_d (double)
SectionMap m_iniData
Stored data of an INI file.
bool get_entryVecf(VectorT &_val, const QString &_section, const QString &_key) const
Get a Vec_n_i (int)