MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / ParseStringFlag

Function ParseStringFlag

test/common/gtest/gtest.cpp:6665–6675  ·  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

6663// On success, stores the value of the flag in *value, and returns
6664// true. On failure, returns false without changing *value.
6665bool ParseStringFlag(const char* str, const char* flag, std::string* value) {
6666 // Gets the value of the flag as a string.
6667 const char* const value_str = ParseFlagValue(str, flag, false);
6668
6669 // Aborts if the parsing failed.
6670 if (value_str == NULL) return false;
6671
6672 // Sets *value to the value of the flag.
6673 *value = value_str;
6674 return true;
6675}
6676
6677// Determines whether a string has a prefix that Google Test uses for its
6678// 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