| 178 | } |
| 179 | |
| 180 | inline int getCmdLineArgumentInt(const int argc, const char **argv, |
| 181 | const char *string_ref) { |
| 182 | bool bFound = false; |
| 183 | int value = -1; |
| 184 | |
| 185 | if (argc >= 1) { |
| 186 | for (int i = 1; i < argc; i++) { |
| 187 | int string_start = stringRemoveDelimiter('-', argv[i]); |
| 188 | const char *string_argv = &argv[i][string_start]; |
| 189 | int length = static_cast<int>(strlen(string_ref)); |
| 190 | |
| 191 | if (!STRNCASECMP(string_argv, string_ref, length)) { |
| 192 | if (length + 1 <= static_cast<int>(strlen(string_argv))) { |
| 193 | int auto_inc = (string_argv[length] == '=') ? 1 : 0; |
| 194 | value = atoi(&string_argv[length + auto_inc]); |
| 195 | } else { |
| 196 | value = 0; |
| 197 | } |
| 198 | |
| 199 | bFound = true; |
| 200 | continue; |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | if (bFound) { |
| 206 | return value; |
| 207 | } else { |
| 208 | return 0; |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | inline float getCmdLineArgumentFloat(const int argc, const char **argv, |
| 213 | const char *string_ref) { |
no test coverage detected