X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/474a9dc37f5085103d11cff3afa8642538f06a10..3261ecc2503f45394eb3b9df97c36b08fb14fb1d:/stglibs/srvconf.lib/parsers/chg_corp.cpp?ds=inline diff --git a/stglibs/srvconf.lib/parsers/chg_corp.cpp b/stglibs/srvconf.lib/parsers/chg_corp.cpp index e566e2ae..852fe8e1 100644 --- a/stglibs/srvconf.lib/parsers/chg_corp.cpp +++ b/stglibs/srvconf.lib/parsers/chg_corp.cpp @@ -20,6 +20,8 @@ #include "chg_corp.h" +#include "resetable_utils.h" + #include "stg/corp_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_CORP::Serialize(const CORP_CONF_RES & conf) +std::string CHG_CORP::Serialize(const CORP_CONF_RES & conf, const std::string & /*encoding*/) { std::ostringstream stream; -appendResetable(stream, "name", conf.name); -appendResetable(stream, "cash", conf.cash); +appendResetableTag(stream, "name", conf.name); +appendResetableTag(stream, "cash", conf.cash); return stream.str(); }