X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..2574a28cbf000603bc31f61593dbf061ff56c1d5:/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp?ds=inline diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp index 8f8e8db5..e22c78fe 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp @@ -23,8 +23,8 @@ #include "stg/tariffs.h" #include "stg/users.h" -#include "stg/optional.h" +#include #include // snprintf #include @@ -57,7 +57,7 @@ std::string AOS2String(const A & array, size_t size, const F C::* field, F multi } template -bool str2res(const std::string& source, STG::Optional& dest, T divisor) +bool str2res(const std::string& source, std::optional& dest, T divisor) { T value = 0; if (str2x(source, value)) @@ -67,7 +67,7 @@ bool str2res(const std::string& source, STG::Optional& dest, T divisor) } template -bool String2AOS(const std::string & source, A & array, size_t size, STG::Optional C::* field, F divisor) +bool String2AOS(const std::string & source, A & array, size_t size, std::optional C::* field, F divisor) { size_t index = 0; std::string::size_type from = 0; @@ -305,7 +305,7 @@ int CHG_TARIFF::Start(void *, const char * el, const char ** attr) { int64_t policyTime = 0; if (str2x(attr[1], policyTime) == 0) - td.tariffConf.changePolicyTimeout = (time_t)policyTime; + td.tariffConf.changePolicyTimeout = policyTime; return 0; } } @@ -314,7 +314,7 @@ int CHG_TARIFF::Start(void *, const char * el, const char ** attr) void CHG_TARIFF::CreateAnswer() { - if (!td.tariffConf.name.data().empty()) + if (!td.tariffConf.name.value().empty()) { auto tariffData = td.get({}); if (m_tariffs.Chg(tariffData, &m_currAdmin) == 0)