1
/***************************************************************************
2
* KBlocks, a falling blocks game for KDE *
3
* Copyright (C) 2010 Zhongjie Cai <squall.leonhart.cai@gmail.com> *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
***************************************************************************/
10
#ifndef KBLOCKSCONFIGMANAGER_H_INCLUDED
11
#define KBLOCKSCONFIGMANAGER_H_INCLUDED
18
class KBlocksConfigManager
21
map< int, string > stConfigSectionList;
22
map< string, map< int, string > > stConfigKeyNameList;
23
map< string, map< string, string > > stConfigDataTable;
28
KBlocksConfigManager();
29
~KBlocksConfigManager();
31
int SetDebugOutput(bool flag);
33
int LoadConfigFile(string filename);
34
int SaveConfigFile(string filename);
36
int GetSectionCount();
37
int GetKeyCount(string SectionName);
39
int GetKeyString(string SectionName, string KeyName, string* KeyString, const string Default);
40
int GetKeyInt(string SectionName, string KeyName, int* KeyInt, const int Default);
41
int GetKeyBool(string SectionName, string KeyName, bool* KeyBool, const bool Default);
43
int SetKeyString(string SectionName, string KeyName, string KeyString);
44
int SetKeyInt(string SectionName, string KeyName, int KeyInt);
45
int SetKeyBool(string SectionName, string KeyName, bool KeyBool);
48
int ParseConfigFile(FILE* fp);
49
int ConstructConfigFile(FILE* fp);
51
string int16tostring(int input);
54
#endif // KBLOCKSCONFIGMANAGER_H_INCLUDED