| 210 | } |
| 211 | |
| 212 | inline float getCmdLineArgumentFloat(const int argc, const char **argv, |
| 213 | const char *string_ref) { |
| 214 | bool bFound = false; |
| 215 | float value = -1; |
| 216 | |
| 217 | if (argc >= 1) { |
| 218 | for (int i = 1; i < argc; i++) { |
| 219 | int string_start = stringRemoveDelimiter('-', argv[i]); |
| 220 | const char *string_argv = &argv[i][string_start]; |
| 221 | int length = static_cast<int>(strlen(string_ref)); |
| 222 | |
| 223 | if (!STRNCASECMP(string_argv, string_ref, length)) { |
| 224 | if (length + 1 <= static_cast<int>(strlen(string_argv))) { |
| 225 | int auto_inc = (string_argv[length] == '=') ? 1 : 0; |
| 226 | value = static_cast<float>(atof(&string_argv[length + auto_inc])); |
| 227 | } else { |
| 228 | value = 0.f; |
| 229 | } |
| 230 | |
| 231 | bFound = true; |
| 232 | continue; |
| 233 | } |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | if (bFound) { |
| 238 | return value; |
| 239 | } else { |
| 240 | return 0; |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | inline bool getCmdLineArgumentString(const int argc, const char **argv, |
| 245 | const char *string_ref, |
no test coverage detected