Changeset 326 for cpp/frams/param/param.cpp
- Timestamp:
- 02/06/15 00:15:08 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/param.cpp
r325 r326 499 499 } 500 500 501 static bool stringIsNumeric(const char* str)502 {// /-?.?[0-9]+/503 if (!str) return false;504 if (*str == '-') str++;505 if (*str == '.') str++;506 return isdigit(*str) != 0;507 }508 509 501 int ParamInterface::setInt(int i, const char* str) 510 502 { 511 if (!stringIsNumeric(str)) 503 paInt value; 504 if (!ExtValue::parseInt(str,value,false,true)) 512 505 { 513 506 paInt mn, mx, def; … … 518 511 } 519 512 else 520 return setInt(i, ExtValue::getInt(str));513 return setInt(i, value); 521 514 } 522 515 523 516 int ParamInterface::setDouble(int i, const char* str) 524 517 { 525 if (!stringIsNumeric(str)) 518 double value; 519 if (!ExtValue::parseDouble(str,value,true)) 526 520 { 527 521 double mn, mx, def; … … 532 526 } 533 527 else 534 return setDouble(i, ExtValue::getDouble(str));528 return setDouble(i, value); 535 529 } 536 530
Note: See TracChangeset
for help on using the changeset viewer.