diff options
author | Willem Jan Palenstijn <wjp@usecode.org> | 2016-07-29 15:31:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-29 15:31:05 +0200 |
commit | 7bb42ddd9e26fc7c01734d26bc114b5a935d9110 (patch) | |
tree | 2318c1454f248991ea6d19b335b422bb20d17603 /python | |
parent | 63bb375eda41e5b5b3b88a0a308fea4c44e25fcf (diff) | |
parent | 584fb584816aefca42518c9a6075ac2df814dac6 (diff) | |
download | astra-7bb42ddd9e26fc7c01734d26bc114b5a935d9110.tar.gz astra-7bb42ddd9e26fc7c01734d26bc114b5a935d9110.tar.bz2 astra-7bb42ddd9e26fc7c01734d26bc114b5a935d9110.tar.xz astra-7bb42ddd9e26fc7c01734d26bc114b5a935d9110.zip |
Merge pull request #62 from wjp/stringutil
Minor string parsing changes
Diffstat (limited to 'python')
-rw-r--r-- | python/astra/src/PythonPluginAlgorithm.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/python/astra/src/PythonPluginAlgorithm.cpp b/python/astra/src/PythonPluginAlgorithm.cpp index 617c0f4..893db94 100644 --- a/python/astra/src/PythonPluginAlgorithm.cpp +++ b/python/astra/src/PythonPluginAlgorithm.cpp @@ -31,8 +31,6 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. #include "astra/Logging.h" #include "astra/Utilities.h" -#include <boost/algorithm/string.hpp> -#include <boost/algorithm/string/split.hpp> #include <iostream> #include <fstream> #include <string> @@ -146,7 +144,7 @@ CPythonPluginAlgorithmFactory::~CPythonPluginAlgorithmFactory(){ PyObject * getClassFromString(std::string str){ std::vector<std::string> items; - boost::split(items, str, boost::is_any_of(".")); + StringUtil::splitString(items, str, "."); PyObject *pyclass = PyImport_ImportModule(items[0].c_str()); if(pyclass==NULL){ logPythonError(); @@ -303,10 +301,10 @@ PyObject * pyStringFromString(std::string str){ PyObject* stringToPythonValue(std::string str){ if(str.find(";")!=std::string::npos){ std::vector<std::string> rows, row; - boost::split(rows, str, boost::is_any_of(";")); + StringUtil::splitString(rows, str, ";"); PyObject *mat = PyList_New(rows.size()); for(unsigned int i=0; i<rows.size(); i++){ - boost::split(row, rows[i], boost::is_any_of(",")); + StringUtil::splitString(row, rows[i], ","); PyObject *rowlist = PyList_New(row.size()); for(unsigned int j=0;j<row.size();j++){ PyList_SetItem(rowlist, j, PyFloat_FromDouble(StringUtil::stringToDouble(row[j]))); @@ -317,7 +315,7 @@ PyObject* stringToPythonValue(std::string str){ } if(str.find(",")!=std::string::npos){ std::vector<std::string> vec; - boost::split(vec, str, boost::is_any_of(",")); + StringUtil::splitString(vec, str, ","); PyObject *veclist = PyList_New(vec.size()); for(unsigned int i=0;i<vec.size();i++){ PyList_SetItem(veclist, i, PyFloat_FromDouble(StringUtil::stringToDouble(vec[i]))); |