* Checks if string is a number - a little bit buggy ... TODO */
| 376 | * Checks if string is a number - a little bit buggy ... TODO |
| 377 | */ |
| 378 | bool Helper::isNumber(const std::string& str) { |
| 379 | bool isNum = true; |
| 380 | size_t str_len = str.size(); |
| 381 | for(size_t i = 0; i < str_len; ++i ) { |
| 382 | unsigned char c = static_cast<unsigned char>(str[i]); |
| 383 | if( !std::isdigit(c) && (c != '.' || c != ',' || c != '-') ) { |
| 384 | isNum = false; |
| 385 | break; |
| 386 | } |
| 387 | } |
| 388 | return isNum; |
| 389 | } |
| 390 | |
| 391 | |
| 392 | /* |