Debian Codegraph @

src/tools/dlgedit/cfg_project.h

raw
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_project.h
21 *
22 * @author Kai Sterker
23 * @brief Project specific configuration data
24 */
25
26 #ifndef CFG_PROJECT_H
27 #define CFG_PROJECT_H
28
29 #include <fstream>
30 #include <string>
31
32 /**
33 * Data that belongs to an individual project. Usually, a project
34 * contains all dialogues that belong to a certain game. The project's
35 * name will be the name of the game, e.g. 'wastesedge'.
36 */
37 class CfgProject
38 {
39 public:
40 /**
41 * Constructor. Creates an empty project with the given name.
42 * @param name The name, or id, of the project.
43 */
44 CfgProject (std::string name);
45
46 /**
47 * Load project specific data from disk.
48 * @return <b>true</b> if successful, <b>false</b> otherwise.
49 */
50 bool load ();
51
52 /**
53 * Save project specific data to disk.
54 * @param file file to save data to.
55 */
56 void save (std::ofstream & file);
57
58 /**
59 * Get the project's name.
60 * @return name (id) of the project
61 */
62 std::string name () { return Name; }
63
64 /**
65 * Get the project's basedir
66 * @return basedir of the project.
67 */
68 std::string basedir () { return BaseDir; }
69
70 /**
71 * Assign a base directory to the project. This is the
72 * root of the dialogue sources belonging to this project.
73 * When working with subdialogues, they will be adressed
74 * relative to the base directory.
75 * @param d the new base directory for this project.
76 */
77 void setBasedir (std::string d) { BaseDir = d; }
78
79 private:
80 std::string Name; // Project Id
81 std::string BaseDir; // Path to dialogue source directory root.
82 };
83
84 #endif // CFG_PROJECT_H