]> git.stg.codes - stg.git/blob - projects/convertor/settings.h
Добавление исходников
[stg.git] / projects / convertor / settings.h
1  /*
2  $Revision: 1.6 $
3  $Date: 2009/06/22 16:26:54 $
4  */
5
6 /*
7  *    This program is free software; you can redistribute it and/or modify
8  *    it under the terms of the GNU General Public License as published by
9  *    the Free Software Foundation; either version 2 of the License, or
10  *    (at your option) any later version.
11  *
12  *    This program is distributed in the hope that it will be useful,
13  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *    GNU General Public License for more details.
16  *
17  *    You should have received a copy of the GNU General Public License
18  *    along with this program; if not, write to the Free Software
19  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 /*
23  *    Date: 27.10.2002
24  */
25
26 /*
27  *    Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
28  */
29
30 #ifndef settingsh_h
31 #define settingsh_h 1
32
33 #include <sys/types.h>
34 #include <vector>
35 #include <dotconfpp.h>
36
37 #include "common.h"
38 #include "base_settings.h"
39 #include "stg_logger.h"
40
41 using namespace std;
42
43 //-----------------------------------------------------------------------------
44 class SETTINGS
45 {
46 public:
47     SETTINGS(const char * cf = "./convertor.conf");
48     ~SETTINGS();
49     int Reload();
50     int ReadSettings();
51
52     string GetStrError() const;
53
54     const string &  GetConfDir() const;
55
56     const string &  GetModulesPath() const;
57     const MODULE_SETTINGS         & GetSourceStoreModuleSettings() const;
58     const MODULE_SETTINGS         & GetDestStoreModuleSettings() const;
59
60 private:
61
62     //int ParseInt(const string & value, int * val);
63     //int ParseIntInRange(const string & value, int min, int max, int * val);
64     //int ParseYesNo(const string & value, bool * val);
65
66     int ParseModuleSettings(const DOTCONFDocumentNode * dirNameNode, vector<PARAM_VALUE> * params);
67
68     string      strError;
69     //////////settings
70     string      modulesPath;
71     string      confFile;
72
73     MODULE_SETTINGS         sourceStoreModuleSettings;
74     MODULE_SETTINGS         destStoreModuleSettings;
75 };
76 //-----------------------------------------------------------------------------
77 #endif
78