| 184 | } |
| 185 | |
| 186 | bool parseInt32(StringSpan token, int32_t& value) |
| 187 | { |
| 188 | char buffer[32]; |
| 189 | SC_TRY(copyTokenToBuffer(token, buffer)); |
| 190 | errno = 0; |
| 191 | char* end = nullptr; |
| 192 | long parsed = ::strtol(buffer, &end, 10); |
| 193 | if (errno == 0 and buffer < end and parsed >= INT32_MIN and parsed <= INT32_MAX) |
| 194 | { |
| 195 | value = static_cast<int32_t>(parsed); |
| 196 | return true; |
| 197 | } |
| 198 | return false; |
| 199 | } |
| 200 | |
| 201 | bool parseFloat(StringSpan token, float& value) |
| 202 | { |
no test coverage detected