]> git.stg.codes - stg.git/blob - projects/sgconv/settings_impl.h
3dfb9596e666cf1f5dcc1f3c6f2ea2201095cc76
[stg.git] / projects / sgconv / settings_impl.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 SETTINGS_IMPL_H
31 #define SETTINGS_IMPL_H
32
33 #include <string>
34 #include <vector>
35
36 struct MODULE_SETTINGS;
37 class DOTCONFDocumentNode;
38
39 class SETTINGS_IMPL {
40 public:
41     SETTINGS_IMPL() : confFile("./sgconv.conf") {}
42     SETTINGS_IMPL(const std::string & cf) : confFile(cf) {}
43     ~SETTINGS_IMPL() {}
44     int ReadSettings();
45
46     std::string GetStrError() const { return strError; }
47
48     const std::string & GetConfDir() const;
49
50     const std::string & GetModulesPath() const { return modulesPath; }
51     const MODULE_SETTINGS & GetSourceStoreModuleSettings() const { return sourceStoreModuleSettings; }
52     const MODULE_SETTINGS & GetDestStoreModuleSettings() const { return destStoreModuleSettings; }
53
54 private:
55     int ParseModuleSettings(const DOTCONFDocumentNode * dirNameNode, std::vector<PARAM_VALUE> * params);
56
57     std::string strError;
58     std::string modulesPath;
59     std::string confFile;
60
61     MODULE_SETTINGS sourceStoreModuleSettings;
62     MODULE_SETTINGS destStoreModuleSettings;
63 };
64
65 #endif