MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / ParseStringFlag

Function ParseStringFlag

rtpose_wrapper/src/gtest/gtest-all.cpp:5935–5945  ·  view source on GitHub ↗

Parses a string for a string flag, in the form of "--flag=value". On success, stores the value of the flag in *value, and returns true. On failure, returns false without changing *value.

Source from the content-addressed store, hash-verified

5933// On success, stores the value of the flag in *value, and returns
5934// true. On failure, returns false without changing *value.
5935bool ParseStringFlag(const char* str, const char* flag, String* value) {
5936 // Gets the value of the flag as a string.
5937 const char* const value_str = ParseFlagValue(str, flag, false);
5938
5939 // Aborts if the parsing failed.
5940 if (value_str == NULL) return false;
5941
5942 // Sets *value to the value of the flag.
5943 *value = value_str;
5944 return true;
5945}
5946
5947// Determines whether a string has a prefix that Google Test uses for its
5948// flags, i.e., starts with GTEST_FLAG_PREFIX_ or GTEST_FLAG_PREFIX_DASH_.

Callers 1

Calls 1

ParseFlagValueFunction · 0.85

Tested by

no test coverage detected