]> git.stg.codes - stg.git/blobdiff - stglibs/srvconf.lib/parsers/chg_corp.cpp
Merge branch 'stg-2.409-radius'
[stg.git] / stglibs / srvconf.lib / parsers / chg_corp.cpp
index e566e2ae07acfb0d46a18bbee1ee3ed836695216..852fe8e1b846a2ce2b7a46b5988fc4a5f15f0380 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "chg_corp.h"
 
+#include "resetable_utils.h"
+
 #include "stg/corp_conf.h"
 #include "stg/common.h"
 
 
 using namespace STG;
 
-namespace
-{
-
-template <typename T>
-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();
 }