phrocker commented on a change in pull request #585: MINIFICPP-910 - Extend 
StringUtils with string join capability
URL: https://github.com/apache/nifi-minifi-cpp/pull/585#discussion_r291419804
 
 

 ##########
 File path: libminifi/include/utils/StringUtils.h
 ##########
 @@ -46,43 +47,53 @@ namespace utils {
 /**
  * Stateless String utility class.
  *
- * Design: Static class, with no member variables
+ * Design: class, with no member variables
  *
  * Purpose: Houses many useful string utilities.
  */
-class StringUtils {
- public:
+
+namespace {
+  template<class Char>
+  struct string_traits;
+  template<>
+  struct string_traits<char>{
+    template<class T>
+    static std::string convert_to_string(T&& t){
+      return std::to_string(std::forward<T>(t));
+    }
+  };
+
+  template<>
+  struct string_traits<wchar_t>{
+    template<class T>
+    static std::wstring convert_to_string(T&& t){
+      return std::to_wstring(std::forward<T>(t));
+    }
+  };
+}
+
+namespace StringUtils {
   /**
    * Converts a string to a boolean
    * Better handles mixed case.
    * @param input input string
    * @param output output string.
    */
-  static bool StringToBool(std::string input, bool &output) {
 
 Review comment:
   This caused issues too. We're giving weak guidance to the linker. So this 
caused issues when running some extensions that are loaded dynamically ( where 
the local linking guidance causes no issues ) -- so while this isn't a bad, 
that must be resolved first. I will try and debug more tomorrow on what is 
causing this, whether it is how it is being built. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to