summaryrefslogtreecommitdiffstats
path: root/src/PluginAlgorithm.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-01-18 17:48:37 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-01-18 17:48:37 +0100
commit29b0cdc83a048ed0bb25f52fd97e020a71e533c6 (patch)
tree57feed06e62fbe9758f1a46fb6c4b1b35442de7c /src/PluginAlgorithm.cpp
parenta7ce7a296545a9361c496e906997c9b7b5d70875 (diff)
parent5773a3d779083bb3dba85106fbe9dc45aeb346ea (diff)
downloadastra-29b0cdc83a048ed0bb25f52fd97e020a71e533c6.tar.gz
astra-29b0cdc83a048ed0bb25f52fd97e020a71e533c6.tar.bz2
astra-29b0cdc83a048ed0bb25f52fd97e020a71e533c6.tar.xz
astra-29b0cdc83a048ed0bb25f52fd97e020a71e533c6.zip
Merge branch 'master'
Diffstat (limited to 'src/PluginAlgorithm.cpp')
-rw-r--r--src/PluginAlgorithm.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/PluginAlgorithm.cpp b/src/PluginAlgorithm.cpp
index 8f7dfc5..9fc511a 100644
--- a/src/PluginAlgorithm.cpp
+++ b/src/PluginAlgorithm.cpp
@@ -30,9 +30,9 @@ $Id$
#include "astra/PluginAlgorithm.h"
#include "astra/Logging.h"
+#include "astra/Utilities.h"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>
-#include <boost/lexical_cast.hpp>
#include <iostream>
#include <fstream>
#include <string>
@@ -338,7 +338,7 @@ PyObject* stringToPythonValue(std::string str){
boost::split(row, rows[i], boost::is_any_of(","));
PyObject *rowlist = PyList_New(row.size());
for(unsigned int j=0;j<row.size();j++){
- PyList_SetItem(rowlist, j, PyFloat_FromDouble(boost::lexical_cast<double>(row[j])));
+ PyList_SetItem(rowlist, j, PyFloat_FromDouble(StringUtil::stringToDouble(row[j])));
}
PyList_SetItem(mat, i, rowlist);
}
@@ -349,16 +349,16 @@ PyObject* stringToPythonValue(std::string str){
boost::split(vec, str, boost::is_any_of(","));
PyObject *veclist = PyList_New(vec.size());
for(unsigned int i=0;i<vec.size();i++){
- PyList_SetItem(veclist, i, PyFloat_FromDouble(boost::lexical_cast<double>(vec[i])));
+ PyList_SetItem(veclist, i, PyFloat_FromDouble(StringUtil::stringToDouble(vec[i])));
}
return veclist;
}
try{
- return PyLong_FromLong(boost::lexical_cast<long>(str));
- }catch(const boost::bad_lexical_cast &){
+ return PyLong_FromLong(StringUtil::stringToInt(str));
+ }catch(const StringUtil::bad_cast &){
try{
- return PyFloat_FromDouble(boost::lexical_cast<double>(str));
- }catch(const boost::bad_lexical_cast &){
+ return PyFloat_FromDouble(StringUtil::stringToDouble(str));
+ }catch(const StringUtil::bad_cast &){
return pyStringFromString(str);
}
}