3 $Date: 2010/08/19 13:42:30 $
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
33 $Date: 2010/08/19 13:42:30 $
40 #include <sys/types.h>
42 #include <dotconfpp.h>
45 #include "base_settings.h"
46 #include "stg_logger.h"
50 //-----------------------------------------------------------------------------
51 enum DETAIL_STAT_PERIOD
58 //-----------------------------------------------------------------------------
63 SETTINGS(const std::string &);
64 SETTINGS(const SETTINGS &);
69 string GetStrError() const;
71 int GetExecMsgKey() const { return stgExecMsgKey; };
72 int GetExecutersNum() const { return executersNum; };
73 //int GetExecutersWaitTimeout() const;
74 const string & GetDirName(int num) const { return dirName[num]; };
75 const string & GetConfDir() const { return confDir; };
76 const string & GetScriptDir() const { return scriptDir; };
77 const string & GetRulesFileName() const { return rules; };
78 const string & GetLogFileName() const { return logFile; };
79 const string & GetPIDFileName() const { return pidFile; };
80 int GetDetailStatWritePeriod() const
81 { return detailStatWritePeriod; };
82 int GetStatWritePeriod() const { return statWritePeriod * 60; };
83 int GetDayFee() const { return dayFee; };
84 bool GetFullFee() const { return fullFee; };
85 int GetDayResetTraff() const { return dayResetTraff; };
86 bool GetSpreadFee() const { return spreadFee; };
87 bool GetFreeMbAllowInet() const { return freeMbAllowInet; };
88 bool GetDayFeeIsLastDay() const { return dayFeeIsLastDay; };
89 bool GetWriteFreeMbTraffCost() const
90 { return writeFreeMbTraffCost; };
91 bool GetShowFeeInCash() const { return showFeeInCash; };
92 const string & GetMonitorDir() const { return monitorDir; };
93 bool GetMonitoring() const { return monitoring; };
95 const string & GetModulesPath() const { return modulesPath; };
96 const MODULE_SETTINGS & GetStoreModuleSettings() const;
97 const vector<MODULE_SETTINGS> & GetModulesSettings() const;
101 int ParseInt(const string & value, int * val);
102 int ParseIntInRange(const string & value, int min, int max, int * val);
103 int ParseYesNo(const string & value, bool * val);
104 int ParseDetailStatWritePeriod(const string & detailStatPeriodStr);
106 int ParseModuleSettings(const DOTCONFDocumentNode * dirNameNode, vector<PARAM_VALUE> * params);
108 static void ErrorCallback(void * data, const char * buf);
113 string dirName[DIR_NUM];
121 int detailStatWritePeriod;
125 //int executersWaitTimeout;
127 int dayFee; // ÄÅÎØ ÓÎÑÔÉÑ ÁÂÏÎÐÌÁÔÙ
128 int dayResetTraff; // îÁÞÁÌÏ ÕÞÅÔÎÏÇÏ ÐÅÒÉÏÄÁ: ÄÅÎØ ÏÂÎÕÌÅÎÉÑ ÔÒÁÆÉËÁ É ÓÍÅÎÙ ÔÁÒÉÆÁ
130 bool freeMbAllowInet;
131 bool dayFeeIsLastDay; // áð ÓÎÉÍÁÅÔÓÑ × ËÏÎÃÅ ÍÅÓÑÃÁ (true) ÉÌÉ × ÎÁÞÁÌÅ (false)
132 bool writeFreeMbTraffCost; // ðÉÓÁÔØ × ÄÅÔÁÌØÎÕÀ ÓÔÁÔÉÓÔÉËÕ ÓÔÏÉÍÏÓÔØ ÔÒÁÆÉËÁ, ÅÓÌÉ ÅÝÅ ÅÓÔØ ÐÒÅÄÏÐÌÁÞÅÎÎÙÊ ÔÒÁÆÉË
133 bool showFeeInCash; // ðÏËÁÚÙ×ÁÔØ ÐÏÌØÚÏ×ÁÔÅÌÀ áð ÎÅ ÓÞÅÔÕ É ÐÏÚ×ÏÌÑÔØ ÅÅ ÉÓÐÏÌØÚÏ×ÁÔØ
135 vector<MODULE_SETTINGS> modulesSettings;
136 MODULE_SETTINGS storeModuleSettings;
140 //-----------------------------------------------------------------------------