MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / SkipPrefix

Function SkipPrefix

tests/gtest/gtest-all.cc:7148–7155  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

7146// past the prefix and returns true; otherwise leaves *pstr unchanged
7147// and returns false. None of pstr, *pstr, and prefix can be NULL.
7148bool 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"

Callers 1

HasGoogleTestFlagPrefixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected