2015-01-26 22:45:15 +00:00
|
|
|
/* LilyPad - Pad plugin for PS2 Emulator
|
|
|
|
* Copyright (C) 2002-2014 PCSX2 Dev Team/ChickenLiver
|
|
|
|
*
|
|
|
|
* File imported from SPU2-X (and tranformed to object)
|
|
|
|
*
|
|
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the
|
|
|
|
* terms of the GNU Lesser General Public License as published by the Free
|
|
|
|
* Software Found- ation, either version 3 of the License, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with PCSX2. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Global.h"
|
|
|
|
#include <wx/fileconf.h>
|
|
|
|
|
2016-09-04 12:16:34 +00:00
|
|
|
extern void CfgSetSettingsDir(const char *dir);
|
2015-01-26 22:45:15 +00:00
|
|
|
|
2016-09-04 12:16:34 +00:00
|
|
|
class CfgHelper
|
|
|
|
{
|
|
|
|
wxFileConfig *m_config;
|
|
|
|
static wxString m_path;
|
2015-01-26 22:45:15 +00:00
|
|
|
|
2016-09-04 12:16:34 +00:00
|
|
|
void setIni(const wchar_t *Section);
|
2015-01-26 22:45:15 +00:00
|
|
|
|
2016-09-04 12:16:34 +00:00
|
|
|
public:
|
|
|
|
CfgHelper();
|
|
|
|
~CfgHelper();
|
2015-01-26 22:45:15 +00:00
|
|
|
|
2016-09-04 12:16:34 +00:00
|
|
|
void WriteBool(const wchar_t *Section, const wchar_t *Name, bool Value);
|
|
|
|
void WriteInt(const wchar_t *Section, const wchar_t *Name, int Value);
|
|
|
|
void WriteFloat(const wchar_t *Section, const wchar_t *Name, float Value);
|
|
|
|
void WriteStr(const wchar_t *Section, const wchar_t *Name, const wxString &Data);
|
2015-01-26 22:45:15 +00:00
|
|
|
|
2016-09-04 12:16:34 +00:00
|
|
|
bool ReadBool(const wchar_t *Section, const wchar_t *Name, bool Default = false);
|
|
|
|
int ReadStr(const wchar_t *Section, const wchar_t *Name, wxString &Data, const wchar_t *Default = 0);
|
|
|
|
int ReadStr(const wchar_t *Section, const wchar_t *Name, wchar_t *Data, const wchar_t *Default = 0);
|
|
|
|
int ReadInt(const wchar_t *Section, const wchar_t *Name, int Default = 0);
|
|
|
|
float ReadFloat(const wchar_t *Section, const wchar_t *Name, float Default = 0.0f);
|
2015-01-26 22:45:15 +00:00
|
|
|
|
2016-09-04 12:16:34 +00:00
|
|
|
static void SetSettingsDir(const char *dir);
|
2015-01-26 22:45:15 +00:00
|
|
|
};
|