| 220 | } |
| 221 | |
| 222 | BENCHMARK_EXPORT |
| 223 | bool ParseInt32Flag(const char* str, const char* flag, int32_t* value) { |
| 224 | // Gets the value of the flag as a string. |
| 225 | const char* const value_str = ParseFlagValue(str, flag, false); |
| 226 | |
| 227 | // Aborts if the parsing failed. |
| 228 | if (value_str == nullptr) return false; |
| 229 | |
| 230 | // Sets *value to the value of the flag. |
| 231 | return ParseInt32(std::string("The value of flag --") + flag, value_str, |
| 232 | value); |
| 233 | } |
| 234 | |
| 235 | BENCHMARK_EXPORT |
| 236 | bool ParseDoubleFlag(const char* str, const char* flag, double* value) { |
no test coverage detected