X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/64b687f8ec36a103865044613cb0f42f98aeda3a..e02bdbcbe32883818ff31548917ef6df9f7a0e9d:/stglibs/srvconf.lib/parsers/resetable_utils.h

diff --git a/stglibs/srvconf.lib/parsers/resetable_utils.h b/stglibs/srvconf.lib/parsers/resetable_utils.h
index ed1cd305..088cb327 100644
--- a/stglibs/srvconf.lib/parsers/resetable_utils.h
+++ b/stglibs/srvconf.lib/parsers/resetable_utils.h
@@ -22,6 +22,7 @@
 #define __STG_STGLIBS_SRVCONF_RESETABLE_UTILS_H__
 
 #include "stg/resetable.h"
+#include "stg/common.h"
 
 #include <string>
 #include <ostream>
@@ -30,6 +31,7 @@ namespace STG
 {
 
 template <typename T>
+inline
 void appendResetable(std::ostream & stream, const std::string & name, const T & value)
 {
 if (!value.empty())
@@ -37,12 +39,31 @@ if (!value.empty())
 }
 
 template <typename T>
+inline
 void appendResetable(std::ostream & stream, const std::string & name, size_t suffix, const T & value)
 {
 if (!value.empty())
     stream << "<" << name << suffix << " value=\"" << value.data() << "\"/>";
 }
 
+inline
+RESETABLE<std::string> MaybeEncode(const RESETABLE<std::string> & value)
+{
+RESETABLE<std::string> res;
+if (!value.empty())
+    res = Encode12str(value.data());
+return res;
+}
+
+inline
+RESETABLE<std::string> MaybeIconv(const RESETABLE<std::string> & value, const std::string & fromEncoding, const std::string & toEncoding)
+{
+RESETABLE<std::string> res;
+if (!value.empty())
+    res = IconvString(value.data(), fromEncoding, toEncoding);
+return res;
+}
+
 } // namespace STG
 
 #endif