If *pstr starts with the given prefix, modifies *pstr to be right past the prefix and returns true; otherwise leaves *pstr unchanged and returns false. None of pstr, *pstr, and prefix can be NULL.
| 7146 | // past the prefix and returns true; otherwise leaves *pstr unchanged |
| 7147 | // and returns false. None of pstr, *pstr, and prefix can be NULL. |
| 7148 | bool SkipPrefix(const char* prefix, const char** pstr) { |
| 7149 | const size_t prefix_len = strlen(prefix); |
| 7150 | if (strncmp(*pstr, prefix, prefix_len) == 0) { |
| 7151 | *pstr += prefix_len; |
| 7152 | return true; |
| 7153 | } |
| 7154 | return false; |
| 7155 | } |
| 7156 | |
| 7157 | // Parses a string as a command line flag. The string should have |
| 7158 | // the format "--flag=value". When def_optional is true, the "=value" |
no outgoing calls
no test coverage detected