MCPcopy Create free account
hub / github.com/apache/singa / ParseStringFlag

Function ParseStringFlag

test/gtest/gtest-all.cc:6233–6243  ·  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

6231// On success, stores the value of the flag in *value, and returns
6232// true. On failure, returns false without changing *value.
6233bool ParseStringFlag(const char* str, const char* flag, std::string* value) {
6234 // Gets the value of the flag as a string.
6235 const char* const value_str = ParseFlagValue(str, flag, false);
6236
6237 // Aborts if the parsing failed.
6238 if (value_str == NULL) return false;
6239
6240 // Sets *value to the value of the flag.
6241 *value = value_str;
6242 return true;
6243}
6244
6245// Determines whether a string has a prefix that Google Test uses for its
6246// 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