]> git.stg.codes - stg.git/blob - stglibs/common_settings.lib/common_settings.h
Добавление исходников
[stg.git] / stglibs / common_settings.lib / common_settings.h
1  /*
2  $Revision: 1.3 $
3  $Date: 2007/10/24 08:04:07 $
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: 29.03.2007
24  *    Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
25  */
26
27  /*
28  $Revision: 1.3 $
29  $Date: 2007/10/24 08:04:07 $
30  */
31
32
33 #ifndef common_settingsh_h
34 #define common_settingsh_h 1
35
36 #include <sys/types.h>
37 #include <vector>
38 //#include <dotconfpp.h>
39
40 #include "common.h"
41 #include "base_settings.h"
42
43 //-----------------------------------------------------------------------------
44 class COMMON_SETTINGS
45 {
46 public:
47     COMMON_SETTINGS();
48     virtual ~COMMON_SETTINGS();
49     virtual int     Reload();
50     virtual int     ReadSettings() = 0;
51
52     virtual std::string  GetStrError() const;
53
54 protected:
55
56     virtual int     ParseInt(const std::string & value, int * val);
57     virtual int     ParseIntInRange(const std::string & value, int min, int max, int * val);
58
59     virtual int     ParseDouble(const std::string & value, double * val);
60     virtual int     ParseDoubleInRange(const std::string & value, double min, double max, double * val);
61
62     virtual int     ParseYesNo(const std::string & value, bool * val);
63
64     mutable std::string strError;
65 };
66 //-----------------------------------------------------------------------------
67 #endif
68