Doomseeker
   
  • Doomseeker
  • Wadseeker
  • Download
  • Tracker
  • Git
  • Docs
  • Main Page
  • Classes
  • Files
  • File List
  • File Members

src/core/ini/ini.h

00001 //------------------------------------------------------------------------------
00002 // ini.h
00003 //------------------------------------------------------------------------------
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018 // 02110-1301  USA
00019 //
00020 //------------------------------------------------------------------------------
00021 // Copyright (C) 2009 "Zalewa" <zalewapl@gmail.com>
00022 //------------------------------------------------------------------------------
00023 #ifndef __INI_H_
00024 #define __INI_H_
00025 
00026 #include "ini/inisection.h"
00027 #include "ini/inivariable.h"
00028 #include "global.h"
00029 #include <QHash>
00030 #include <QSettings>
00031 #include <QString>
00032 #include <QStringList>
00033 #include <QVector>
00034 
00067 class MAIN_EXPORT Ini : public QObject
00068 {
00069         public:
00073                 Ini(const QString& filename);
00074                 ~Ini();
00075 
00080                 IniSection                      createSection(const QString& name);
00081 
00087                 IniVariable             createSetting(const QString& sectionname, const QString& name, const QVariant& data);
00088 
00092                 void                            deleteSection(const QString& sectionname);
00093 
00098                 void                            deleteSetting(const QString& sectionname, const QString& settingname);
00099 
00108                 bool                            loadIniFile(const QString &filePath);
00109 
00110                 void                            removeKey(const QString& key);
00111 
00117                 IniSection              retrieveSection(const QString& name);
00118 
00125                 IniVariable             retrieveSetting(const QString& sectionname, const QString& variablename);
00126 
00132                 bool                            save();
00133 
00146                 IniSection                      section(const QString& name);
00147 
00154                 QVector<IniSection>     sectionsArray(const QString& regexPattern);
00155 
00162                 IniVariable             setting(const QString& sectionname, const QString& variablename);
00163 
00164                 void                            setValue(const QString& key, const QVariant& value);
00165                 QVariant                        value(const QString& key) const;
00166 
00167         private:
00168                 QSettings*          pIni;
00169 };
00170 
00171 #endif
   
Doomseeker © 2009-2024 The Doomseeker Team