X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/5014a9d76df7cbe75b175d635908049ccd702c81..acdf6ab94fee26ebc4017bf32cf6171c7d9462e9:/projects/stargazer/plugins/configuration/sgconfig/parser_services.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_services.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_services.cpp index 0c1e1476..118d819e 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_services.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_services.cpp @@ -47,14 +47,14 @@ void GET_SERVICES::CreateAnswer() }*/ m_answer = ""; - SERVICE_CONF conf; + ServiceConf conf; int h = m_services.OpenSearch(); while (m_services.SearchNext(h, &conf) == 0) { m_answer += ""; + "\" cost=\"" + std::to_string(conf.cost) + + "\" payDay=\"" + std::to_string(conf.payDay) + "\"/>"; } m_services.CloseSearch(h); m_answer += ""; @@ -80,14 +80,14 @@ void GET_SERVICE::CreateAnswer() return; }*/ - SERVICE_CONF conf; + ServiceConf conf; if (!m_services.Find(m_name, &conf)) m_answer = ""; else m_answer += "<" + m_tag + " name=\"" + conf.name + "\" comment=\"" + Encode12str(conf.comment) + - "\" cost=\"" + x2str(conf.cost) + - "\" payDay=\"" + x2str(conf.payDay) + "\"/>"; + "\" cost=\"" + std::to_string(conf.cost) + + "\" payDay=\"" + std::to_string(conf.payDay) + "\"/>"; } int ADD_SERVICE::Start(void *, const char * el, const char ** attr) @@ -102,11 +102,11 @@ int ADD_SERVICE::Start(void *, const char * el, const char ** attr) void ADD_SERVICE::CreateAnswer() { - SERVICE_CONF conf(m_name); + ServiceConf conf(m_name); if (m_services.Add(conf, &m_currAdmin) == 0) m_answer = "<" + m_tag + " result=\"Ok\"/>"; else - m_answer = "<" + m_tag + " result=\"Error. " + m_services.GetStrError() + "\"/>"; + m_answer = "<" + m_tag + " result=\"" + m_services.GetStrError() + "\"/>"; } int DEL_SERVICE::Start(void *, const char * el, const char ** attr) @@ -124,7 +124,7 @@ void DEL_SERVICE::CreateAnswer() if (m_services.Del(m_name, &m_currAdmin) == 0) m_answer = "<" + m_tag + " result=\"Ok\"/>"; else - m_answer = "<" + m_tag + " result=\"Error. " + m_services.GetStrError() + "\"/>"; + m_answer = "<" + m_tag + " result=\"" + m_services.GetStrError() + "\"/>"; } int CHG_SERVICE::Start(void *, const char * el, const char ** attr) @@ -190,13 +190,13 @@ void CHG_SERVICE::CreateAnswer() return; } - SERVICE_CONF orig; + ServiceConf orig; m_services.Find(m_service.name.const_data(), &orig); - SERVICE_CONF_RES conf(orig); - conf.Splice(m_service); + ServiceConfOpt conf(orig); + conf.splice(m_service); - if (m_services.Change(conf.GetData(), &m_currAdmin) != 0) + if (m_services.Change(conf.get({}), &m_currAdmin) != 0) m_answer = "<" + m_tag + " result = \"" + m_services.GetStrError() + "\"/>"; else m_answer = "<" + m_tag + " result = \"Ok\"/>";