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

Function ParseInt32Flag

test/common/gtest/gtest.cpp:6648–6658  ·  view source on GitHub ↗

Parses a string for an Int32 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

6646// On success, stores the value of the flag in *value, and returns
6647// true. On failure, returns false without changing *value.
6648bool ParseInt32Flag(const char* str, const char* flag, Int32* value) {
6649 // Gets the value of the flag as a string.
6650 const char* const value_str = ParseFlagValue(str, flag, false);
6651
6652 // Aborts if the parsing failed.
6653 if (value_str == NULL) return false;
6654
6655 // Sets *value to the value of the flag.
6656 return ParseInt32(Message() << "The value of flag --" << flag,
6657 value_str, value);
6658}
6659
6660// Parses a string for a string flag, in the form of
6661// "--flag=value".

Callers 1

Calls 3

ParseFlagValueFunction · 0.85
ParseInt32Function · 0.85
MessageFunction · 0.70

Tested by

no test coverage detected