Back
1 //------------------------------------------------------------------------------
2 // Module Project.cpp //
3 // //
4 // Class TProject is derived from TOptions. Additionally some project //
5 // data like input/output file lists is added. //
6 // //
7 // Copyright (c) 2000-2004 by Lars Haendel //
8 // Home: http://www.newty.de //
9 // //
10 // This program is free software; you can redistribute it and/or modify //
11 // it under the terms of the GNU General Public License as published by //
12 // the Free Software Foundation as version 2 of the License. //
13 // //
14 // This program is distributed in the hope that it will be useful, //
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
17 // GNU General Public License for more details. //
18 // //
19 // You should have received a copy of the GNU General Public License //
20 // along with this program; if not, write to the Free Software //
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
22 // //
23 //------------------------------------------------------------------------------
24
25
26 #ifndef ProjectH
27 #define ProjectH
28
29 #include "options.h" // due to: TOptions
30 #include "defines.h" // STS (string size)
31 #include "StdList.h" // TStdList
32
33
34 // filename definition for source and destination filename lists
35 typedef char TStringSTS[STS];
36
37
38 //----------------------------------------------------------------------------------------------------------------------
39 // class TProject. Derived from TOptions
40 class TProject : public TOptions
41 {
42 public:
43
44 //-------------------------------------------------------------------------------------------------------------------
45
46 TProject(); // constructor/destructor
47
48 void Load(ifstream& file); // load project from file
49 void Save(ofstream& file); // save project to file
50
51 void RestoreDefaults(const TOptions& defaults); // restore factory defaults settings
52
53
54 //-------------------------------------------------------------------------------------------------------------------
55 // functions to access source and destination filename lists
56 const char* GetDestinationFileName(const int& i); // get i'th destination filename
57 const char* GetSourceFileName (const int& i) { return szSrcFiles.Get(i); }; // get i'th source filename
58
59 void AddFileNames(const char*const& szSrcFile, const char*const& szDesFile) // add source and destination filenames
60 { strcpy(szSrcFiles.Ins(), szSrcFile); strcpy(szDesFiles.Ins(), szDesFile); };
61
62 void SetDestinationFileName(const char*const& szFileName, const int& i)
63 { strcpy(szDesFiles.Get(i), szFileName); }; // set/overwrite i'th destination filename
64
65
66 int nFiles() { return szSrcFiles.Size(); }; // return # of filenames
67 void ClearFileNames() { szSrcFiles.Clear(); szDesFiles.Clear(); }; // clear filename lists
68 void DeleteFileName(const int& i) // delete i'th source and destination filename
69 { szSrcFiles.Del(i); szDesFiles.Del(i); };
70
71
72
73 // some other project options
74 char szLanguage[STS]; // language name
75 char szStyle[STS]; // highlighting style
76 bool f_OverwriteExistingFiles; // overwrite existing file
77 bool f_ShowPath; // show path in list view
78 bool f_EnforceOutputDir; //
79 char szOutputDir[STS]; // output directory
80
81 private:
82
83 // source and destination filename lists
84 TStdList<TStringSTS> szSrcFiles; // list with source filenames
85 TStdList<TStringSTS> szDesFiles; // list with destination filenames
86 };
87 #endif
Top |