X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/99090ca5351c98fd9ce9773456a8a3c3936e8c60..9af0b6faad1f5e6ca2206f7cddc02885a08e718c:/stglibs/srvconf.lib/parsers/chg_service.cpp diff --git a/stglibs/srvconf.lib/parsers/chg_service.cpp b/stglibs/srvconf.lib/parsers/chg_service.cpp index 2eed494f..7dac5ba9 100644 --- a/stglibs/srvconf.lib/parsers/chg_service.cpp +++ b/stglibs/srvconf.lib/parsers/chg_service.cpp @@ -20,6 +20,8 @@ #include "chg_service.h" +#include "resetable_utils.h" + #include "stg/service_conf.h" #include "stg/common.h" @@ -27,24 +29,12 @@ using namespace STG; -namespace -{ - -template -void appendResetable(std::ostream & stream, const std::string & name, const T & value) -{ -if (!value.empty()) - stream << "<" << name << " value=\"" << value.data() << "\"/>"; -} - -} // namespace anonymous - -std::string CHG_SERVICE::Serialize(const SERVICE_CONF_RES & conf) +std::string CHG_SERVICE::Serialize(const SERVICE_CONF_RES & conf, const std::string & /*encoding*/) { std::ostringstream stream; appendResetable(stream, "name", conf.name); -appendResetable(stream, "comment", conf.comment); +appendResetable(stream, "comment", MaybeEncode(conf.comment)); appendResetable(stream, "cost", conf.cost); appendResetable(stream, "payDay", conf.payDay);