X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/6d2d8f97a73949a7776f67ded7f36bbfe4bba980..4ca22a7c19dd0b94609280faf64108b1ea54e415:/projects/stargazer/settings_impl.cpp?ds=sidebyside diff --git a/projects/stargazer/settings_impl.cpp b/projects/stargazer/settings_impl.cpp index 14609647..f9135a1a 100644 --- a/projects/stargazer/settings_impl.cpp +++ b/projects/stargazer/settings_impl.cpp @@ -32,9 +32,9 @@ $Author: faust $ #include #include +#include "stg/logger.h" +#include "stg/dotconfpp.h" #include "settings_impl.h" -#include "stg_logger.h" -#include "dotconfpp.h" using namespace std; @@ -63,6 +63,8 @@ SETTINGS_IMPL::SETTINGS_IMPL() writeFreeMbTraffCost(false), showFeeInCash(true), messageTimeout(0), + feeChargeType(0), + reconnectOnTariffChange(false), modulesSettings(), storeModuleSettings(), logger(GetStgLogger()) @@ -93,6 +95,8 @@ SETTINGS_IMPL::SETTINGS_IMPL(const std::string & cd) writeFreeMbTraffCost(false), showFeeInCash(true), messageTimeout(0), + feeChargeType(0), + reconnectOnTariffChange(false), modulesSettings(), storeModuleSettings(), logger(GetStgLogger()) @@ -123,6 +127,8 @@ SETTINGS_IMPL::SETTINGS_IMPL(const SETTINGS_IMPL & rval) writeFreeMbTraffCost(rval.writeFreeMbTraffCost), showFeeInCash(rval.showFeeInCash), messageTimeout(rval.messageTimeout), + feeChargeType(rval.feeChargeType), + reconnectOnTariffChange(rval.reconnectOnTariffChange), modulesSettings(rval.modulesSettings), storeModuleSettings(rval.storeModuleSettings), logger(GetStgLogger()) @@ -235,9 +241,9 @@ return 0; //----------------------------------------------------------------------------- void SETTINGS_IMPL::ErrorCallback(void * data, const char * buf) { - printfd(__FILE__, buf); + printfd(__FILE__, "SETTINGS_IMPL::ErrorCallback() - %s\n", buf); SETTINGS_IMPL * settings = static_cast(data); - settings->logger(buf); + settings->logger("%s", buf); } //----------------------------------------------------------------------------- int SETTINGS_IMPL::ReadSettings() @@ -429,6 +435,24 @@ while (node) } } + if (strcasecmp(node->getName(), "FeeChargeType") == 0) + { + if (ParseUnsignedInRange(node->getValue(0), 0, 2, &feeChargeType) != 0) + { + strError = "Incorrect FeeChargeType value: \'" + string(node->getValue(0)) + "\'"; + return -1; + } + } + + if (strcasecmp(node->getName(), "ReconnectOnTariffChange") == 0) + { + if (ParseYesNo(node->getValue(0), &reconnectOnTariffChange) != 0) + { + strError = "Incorrect ReconnectOnTariffChange value: \'" + string(node->getValue(0)) + "\'"; + return -1; + } + } + if (strcasecmp(node->getName(), "DirNames") == 0) { const DOTCONFDocumentNode * child = node->getChildNode();