| 1 |
/* |
| 2 |
Copyright (C) 2002 Kai Sterker <[email protected]> |
| 3 |
Part of the Adonthell Project <http://adonthell.nongnu.org> |
| 4 |
|
| 5 |
Dlgedit 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 |
Dlgedit is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
GNU General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public License |
| 16 |
along with Dlgedit. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
*/ |
| 18 |
|
| 19 |
/** |
| 20 |
* @file cfg_io.h |
| 21 |
* |
| 22 |
* @author Kai Sterker |
| 23 |
* @brief I/O Routines for dlgedit configuration file |
| 24 |
*/ |
| 25 |
|
| 26 |
#ifndef CFG_IO_H |
| 27 |
#define CFG_IO_H |
| 28 |
|
| 29 |
#include "cfg_data.h" |
| 30 |
|
| 31 |
/** |
| 32 |
* This class implements loading and saving of the dlgedit configuration |
| 33 |
* file. On Unix systems, the configuration is $HOME/.adonthell/dlgeditrc. |
| 34 |
* |
| 35 |
* The configuration contains a global section and project specific |
| 36 |
* sections. The global section stores infos like recently opened files, |
| 37 |
* while the project sections contains the base source directory of that |
| 38 |
* project. |
| 39 |
* |
| 40 |
* Only games that are located in DATA_DIR/games are valid projects. |
| 41 |
*/ |
| 42 |
class CfgIO |
| 43 |
{ |
| 44 |
public: |
| 45 |
/** |
| 46 |
* Constructor. Computes the path to the config file and loads it. |
| 47 |
*/ |
| 48 |
CfgIO (); |
| 49 |
|
| 50 |
/** |
| 51 |
* Destructor. Saves all changes to the config file. |
| 52 |
*/ |
| 53 |
~CfgIO (); |
| 54 |
|
| 55 |
private: |
| 56 |
/** |
| 57 |
* Load configuration from ~/.adonthell/dlgeditrc. |
| 58 |
*/ |
| 59 |
void load (); |
| 60 |
/** |
| 61 |
* Save configuration to ~/.adonthell/dlgeditrc. |
| 62 |
*/ |
| 63 |
void save (); |
| 64 |
|
| 65 |
CfgData Data; // Global configuration data |
| 66 |
std::string Dlgeditrc; // Path to configuration file |
| 67 |
}; |
| 68 |
|
| 69 |
#endif // CFG_IO_H |