| 24 |
|
*/ |
| 25 |
|
|
| 26 |
|
#include <iostream> |
| 27 |
+ |
#include <iterator> |
| 28 |
|
#include <sstream> |
| 29 |
|
#include "utils/StringTokenizer.hpp" |
| 30 |
|
|
| 71 |
|
++numToken; |
| 72 |
|
} |
| 73 |
|
} |
| 74 |
< |
|
| 74 |
> |
|
| 75 |
> |
if (tmpIter == end_) { |
| 76 |
> |
break; |
| 77 |
> |
} |
| 78 |
> |
|
| 79 |
|
//encount a token here |
| 80 |
|
while ( tmpIter != end_ && !isDelimiter(*tmpIter) ) { |
| 81 |
|
++tmpIter; |
| 82 |
|
} |
| 83 |
|
|
| 84 |
< |
if (tmpIter != end_) { |
| 80 |
< |
++numToken; |
| 81 |
< |
} else { |
| 82 |
< |
break; |
| 83 |
< |
} |
| 84 |
> |
++numToken; |
| 85 |
|
|
| 86 |
|
} |
| 87 |
|
|
| 139 |
|
if (iss >> result) { |
| 140 |
|
return result; |
| 141 |
|
} else { |
| 142 |
< |
std::cerr << "unable to convert " << token << "to a bool" << std::endl; |
| 142 |
> |
std::cerr << "unable to convert " << token << " to a bool" << std::endl; |
| 143 |
|
return false; |
| 144 |
|
} |
| 145 |
|
} |
| 152 |
|
if (iss >> result) { |
| 153 |
|
return result; |
| 154 |
|
} else { |
| 155 |
< |
std::cerr << "unable to convert " << token << "to an integer" << std::endl; |
| 155 |
> |
std::cerr << "unable to convert " << token << " to an integer" << std::endl; |
| 156 |
|
return 0; |
| 157 |
|
} |
| 158 |
|
} |
| 165 |
|
if (iss >> result) { |
| 166 |
|
return result; |
| 167 |
|
} else { |
| 168 |
< |
std::cerr << "unable to convert " << token << "to a float" << std::endl; |
| 168 |
> |
std::cerr << "unable to convert " << token << " to a float" << std::endl; |
| 169 |
|
return 0.0; |
| 170 |
|
} |
| 171 |
|
} |
| 178 |
|
if (iss >> result) { |
| 179 |
|
return result; |
| 180 |
|
} else { |
| 181 |
< |
std::cerr << "unable to convert " << token << "to a double" << std::endl; |
| 181 |
> |
std::cerr << "unable to convert " << token << " to a double" << std::endl; |
| 182 |
|
return 0.0; |
| 183 |
|
} |
| 184 |
|
} |