class SETTINGS {
public:
virtual ~SETTINGS() {}
- virtual const std::string & GetDirName(size_t num) const = 0;
- virtual const std::string & GetScriptsDir() const = 0;
- virtual unsigned GetDetailStatWritePeriod() const = 0;
- virtual unsigned GetStatWritePeriod() const = 0;
- virtual unsigned GetDayFee() const = 0;
- virtual bool GetFullFee() const = 0;
- virtual unsigned GetDayResetTraff() const = 0;
- virtual bool GetSpreadFee() const = 0;
- virtual bool GetFreeMbAllowInet() const = 0;
- virtual bool GetDayFeeIsLastDay() const = 0;
- virtual bool GetWriteFreeMbTraffCost() const = 0;
- virtual bool GetShowFeeInCash() const = 0;
- virtual unsigned GetMessageTimeout() const = 0;
- virtual unsigned GetFeeChargeType() const = 0;
- virtual bool GetReconnectOnTariffChange() const = 0;
- virtual const std::string & GetMonitorDir() const = 0;
- virtual bool GetMonitoring() const = 0;
+ virtual const std::string & GetDirName(size_t num) const = 0;
+ virtual const std::string & GetScriptsDir() const = 0;
+ virtual unsigned GetDetailStatWritePeriod() const = 0;
+ virtual unsigned GetStatWritePeriod() const = 0;
+ virtual unsigned GetDayFee() const = 0;
+ virtual bool GetFullFee() const = 0;
+ virtual unsigned GetDayResetTraff() const = 0;
+ virtual bool GetSpreadFee() const = 0;
+ virtual bool GetFreeMbAllowInet() const = 0;
+ virtual bool GetDayFeeIsLastDay() const = 0;
+ virtual bool GetWriteFreeMbTraffCost() const = 0;
+ virtual bool GetShowFeeInCash() const = 0;
+ virtual unsigned GetMessageTimeout() const = 0;
+ virtual unsigned GetFeeChargeType() const = 0;
+ virtual bool GetReconnectOnTariffChange() const = 0;
+ virtual const std::string & GetMonitorDir() const = 0;
+ virtual bool GetMonitoring() const = 0;
+ virtual const std::vector<std::string> & GetScriptParams() const = 0;
};
//-----------------------------------------------------------------------------
if (settings->ReadSettings())
{
STG_LOGGER & WriteServLog = GetStgLogger();
-
if (settings->GetLogFileName() != "")
WriteServLog.SetLogFileName(settings->GetLogFileName());
WriteServLog("ReadSettings error. %s", settings->GetStrError().c_str());
exit(1);
}
-
+/*************************************************************************************************/
+//вывод scriptParams
+ printfd(__FILE__, "--- Script params dump ---\n");
+ std::vector<std::string>::const_iterator it(settings->GetScriptParams().begin());
+ while (it != settings->GetScriptParams().end())
+ {
+ printfd(__FILE__, "%s\n", it->c_str());
+ it++;
+ }
+ printfd(__FILE__, "--- End dump ---\n");
+/*************************************************************************************************/
+
#ifndef NO_DAEMON
std::string startFile(settings->GetConfDir() + START_FILE);
#endif
{
rules = node->getValue(0);
}
-
+
if (strcasecmp(node->getName(), "DetailStatWritePeriod") == 0)
{
if (ParseDetailStatWritePeriod(node->getValue(0)) != 0)
}
}
+ if (strcasecmp(node->getName(), "ScriptParams") == 0)
+ {
+ int i;
+ i=0;
+ while (node->getValue(i)!=NULL)
+ {
+ scriptParams.push_back(node->getValue(i));
+ i++;
+ }
+ }
node = node->getNextNode();
}
return -1;
}
-//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
\ No newline at end of file
{ return storeModuleSettings; }
const std::vector<MODULE_SETTINGS> & GetModulesSettings() const
{ return modulesSettings; }
+
+ const std::vector<std::string> & GetScriptParams() const {return scriptParams; }
private:
std::string logFile;
std::string pidFile;
std::string monitorDir;
+
+ std::vector<std::string> scriptParams;
+
bool monitoring;
unsigned detailStatWritePeriod;
unsigned statWritePeriod;
std::vector<MODULE_SETTINGS> modulesSettings;
MODULE_SETTINGS storeModuleSettings;
-
+
STG_LOGGER & logger;
};
//-----------------------------------------------------------------------------