return true on success.
| 704 | |
| 705 | // return true on success. |
| 706 | bool StringToFloat(float * fval, const char * str) |
| 707 | { |
| 708 | if (!str) |
| 709 | { |
| 710 | return false; |
| 711 | } |
| 712 | |
| 713 | std::istringstream inputStringstream(str); |
| 714 | float x; |
| 715 | if (!(inputStringstream >> x)) |
| 716 | { |
| 717 | return false; |
| 718 | } |
| 719 | |
| 720 | if (fval) |
| 721 | { |
| 722 | *fval = x; |
| 723 | } |
| 724 | return true; |
| 725 | } |
| 726 | |
| 727 | bool StringToInt(int * ival, const char * str) |
| 728 | { |
no outgoing calls