File tree Expand file tree Collapse file tree 2 files changed +1
-45
lines changed
Expand file tree Collapse file tree 2 files changed +1
-45
lines changed Original file line number Diff line number Diff line change 4444#include < Core/IEPlugin/SimpleTextFileToMatrix_Plugin.h>
4545#include < Core/Datatypes/DenseMatrix.h>
4646#include < Core/Datatypes/MatrixTypeConversions.h>
47- #include < Core/Utils/StringUtil.h>
47+ #include < Core/Utils/Legacy/ StringUtil.h>
4848#include < Core/Logging/LoggerInterface.h>
4949
5050#include < iostream>
Original file line number Diff line number Diff line change @@ -108,50 +108,6 @@ struct SCISHARE AtomicCounter
108108
109109SCISHARE bool replaceSubstring (std::string& str, const std::string& from, const std::string& to);
110110
111- template <class T >
112- bool from_string (const std::string &str, T &value)
113- {
114- std::istringstream iss (str+" " );
115- iss.exceptions (std::ifstream::eofbit | std::ifstream::failbit | std::ifstream::badbit);
116- try
117- {
118- iss >> value;
119- return (true );
120- }
121- catch (...)
122- {
123- return (false );
124- }
125- }
126-
127- // TODO: replace with boost::regex
128- template <class T >
129- bool multiple_from_string (const std::string &str, std::vector<T> &values)
130- {
131- values.clear ();
132-
133- std::string data = str;
134- for (size_t j=0 ; j<data.size (); j++)
135- if ((data[j] == ' \t ' )||(data[j] == ' \r ' )||(data[j] == ' \n ' )||(data[j]==' "' )) data[j] = ' ' ;
136-
137- std::vector<std::string> nums;
138- for (size_t p=0 ;p<data.size ();)
139- {
140- while ((data[p] == ' ' )&&(p<data.size ())) p++;
141- if (p >= data.size ()) break ;
142-
143- std::string::size_type next_space = data.find (' ' ,p);
144- if (next_space == std::string::npos) next_space = data.size ();
145- T value;
146- if (from_string (data.substr (p,next_space-p), value)) values.push_back (value);
147- p = next_space;
148-
149- if (p >= data.size ()) break ;
150- }
151- if (values.size () > 0 ) return (true );
152- return (false );
153- }
154-
155111}}
156112
157113namespace std
You can’t perform that action at this time.
0 commit comments