| 62 | } |
| 63 | |
| 64 | bool isStringFloat(const std::string& str) |
| 65 | { |
| 66 | std::string modifyStr = str; |
| 67 | bool isFloat = false; |
| 68 | if (!modifyStr.empty()) |
| 69 | { |
| 70 | if (modifyStr.substr(0, 1) == "-") |
| 71 | modifyStr = modifyStr.substr(1); |
| 72 | if (occurencesInString(modifyStr, ".") == 1) |
| 73 | { |
| 74 | isFloat = true; |
| 75 | replaceInPlace(modifyStr, ".", ""); |
| 76 | } |
| 77 | return (all_of(modifyStr.begin(), modifyStr.end(), isdigit) && isFloat); |
| 78 | } |
| 79 | return false; |
| 80 | } |
| 81 | |
| 82 | bool isStringNumeric(const std::string& str) |
| 83 | { |
no test coverage detected