Update wrt-plugins-common_0.3.53
[framework/web/wrt-plugins-common.git] / src / Commons / StringUtils.cpp
index 4795131..1fe0b7a 100644 (file)
@@ -17,8 +17,6 @@
 #include <algorithm>
 #include <iterator>
 #include <new>
-#include <sstream>
-#include <Commons/Exception.h>
 #include "StringUtils.h"
 
 namespace WrtDeviceApis {
@@ -106,7 +104,7 @@ char* strdup(const char* str)
 }
 
 std::string merge(const std::vector<std::string>& strs,
-        std::string::value_type delim)
+                  std::string::value_type delim)
 {
     typedef std::vector<std::string> Strings;
 
@@ -138,16 +136,11 @@ std::vector<std::string> split(const std::string& str,
     return result;
 }
 
-int toInt(const std::string &text)
+int toInt(const std::string& str)
 {
-    int result;
-    std::stringstream ss(text);
-    if (!(ss >> result)) {
-        Throw(ConversionException);
-    }
-    return result;
+    return convertTo<int>(str);
 }
 
 }
 }
-} // WrtDeviceApisCommon
+}