47 #ifndef TOOLS_INIFILE_HH 48 #define TOOLS_INIFILE_HH 110 bool connect(
const QString& name,
120 const QString&
name()
const {
return m_filename; }
129 bool section_exists(
const QString & _section)
const;
132 bool entry_exists(
const QString & _section,
const QString & _key)
const;
136 const QString & _key)
const 137 {
return entry_exists( _section, _key ); }
148 void add_section(
const QString & _sectionname);
151 void add_entry(
const QString & _section,
152 const QString & _key,
153 const QString & _value );
157 const QString & _key,
158 const char * _value )
159 { add_entry( _section, _key, QString(_value) ); }
162 void add_entry(
const QString & _section,
163 const QString & _key,
164 const double & _value);
167 void add_entry(
const QString & _section,
168 const QString & _key,
169 const float & _value);
172 void add_entry(
const QString & _section,
173 const QString & _key ,
177 void add_entry(
const QString & _section,
178 const QString & _key ,
179 const unsigned int & _value);
182 void add_entry(
const QString & _section,
183 const QString & _key ,
184 const bool & _value);
187 void add_entry(
const QString & _section,
188 const QString & _key ,
189 const std::vector<float> & _value);
192 void add_entry(
const QString & _section,
193 const QString & _key ,
194 const std::vector<double> & _value);
197 void add_entry(
const QString & _section,
198 const QString & _key ,
199 const std::vector<bool> & _value);
202 template <
typename VectorT >
203 void add_entryVec (
const QString & _section,
204 const QString & _key,
208 template <
typename VectorT >
209 void add_entryVec (
const QString & _section,
210 const QString & _key,
211 const std::vector< VectorT > & _value);
214 void add_entry(
const QString & _section,
215 const QString & _key ,
216 const std::vector<int> & _value);
219 void add_entry(
const QString & _section,
220 const QString & _key ,
221 const std::vector<QString> & _value);
224 void add_entry(
const QString & _section,
225 const QString & _key ,
226 const QStringList & _value);
238 void delete_entry(
const QString & _section,
const QString & _key);
241 void delete_section(
const QString & _sectionname );
253 bool get_entry( QString & _val,
254 const QString & _section,
255 const QString & _key )
const;
258 bool get_entry(
double & _val,
259 const QString & _section,
260 const QString & _key )
const;
263 bool get_entry(
float & _val,
264 const QString & _section,
265 const QString & _key )
const;
268 bool get_entry(
int & _val,
269 const QString & _section,
270 const QString & _key )
const;
273 bool get_entry(
unsigned int & _val,
274 const QString & _section,
275 const QString & _key )
const;
278 bool get_entry(
bool & _val,
279 const QString & _section,
280 const QString & _key)
const;
283 bool get_entry( std::vector<float> & _val,
284 const QString & _section,
285 const QString & _key)
const;
288 bool get_entry( std::vector<double> & _val,
289 const QString & _section,
290 const QString & _key)
const;
293 bool get_entry( std::vector<bool> & _val,
294 const QString & _section,
295 const QString & _key)
const;
298 bool get_entry( std::vector<int> & _val,
299 const QString & _section,
300 const QString & _key)
const;
303 bool get_entry( std::vector<QString> & _val,
304 const QString & _section,
305 const QString & _key )
const;
308 bool get_entry( QStringList & _val,
309 const QString & _section,
310 const QString & _key )
const;
313 template <
typename VectorT >
314 bool get_entryVecd (
VectorT & _val ,
315 const QString & _section,
316 const QString & _key )
const;
319 template <
typename VectorT >
320 bool get_entryVecf (
VectorT & _val ,
321 const QString & _section,
322 const QString & _key )
const;
325 template <
typename VectorT >
326 bool get_entryVeci (
VectorT & _val ,
327 const QString & _section,
328 const QString & _key )
const;
331 template <
typename VectorT >
332 bool get_entryVecd (std::vector< VectorT > & _val ,
333 const QString & _section,
334 const QString & _key )
const;
337 template <
typename VectorT >
338 bool get_entryVecf (std::vector< VectorT > & _val ,
339 const QString & _section,
340 const QString & _key )
const;
343 template <
typename VectorT >
344 bool get_entryVeci (std::vector< VectorT > & _val ,
345 const QString & _section,
346 const QString & _key )
const;
364 bool parseFile( QFile & _inputStream );
367 bool writeFile(
void );
381 #if defined(INCLUDE_TEMPLATES) && !defined(INIFILE_C) 382 #define INIFILE_TEMPLATES 383 #include "INIFileT_impl.hh" void add_entry(const QString &_section, const QString &_key, const char *_value)
Addition / modification of a string entry, given as char array.
bool mf_isConnected
Flag: this object is connected to an INI file.
bool is_connected() const
Check if object is connected to file.
std::map< QString, EntryMap > SectionMap
Type for map of contained sections.
const QString & name() const
Access to name of connected file.
std::map< QString, QString > EntryMap
Type for map of contained entries.
bool entry_in_section(const QString &_section, const QString &_key) const
Same as entry_exists() (for backward compatibility)
QString m_filename
Name of current INI file.
SectionMap m_iniData
Stored data of an INI file.
Class for the handling of simple configuration files.