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

Function ParseInt32Flag

tests/gtest/gtest-all.cc:7216–7226  ·  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

7214// On success, stores the value of the flag in *value, and returns
7215// true. On failure, returns false without changing *value.
7216bool ParseInt32Flag(const char* str, const char* flag, Int32* value) {
7217 // Gets the value of the flag as a string.
7218 const char* const value_str = ParseFlagValue(str, flag, false);
7219
7220 // Aborts if the parsing failed.
7221 if (value_str == nullptr) return false;
7222
7223 // Sets *value to the value of the flag.
7224 return ParseInt32(Message() << "The value of flag --" << flag,
7225 value_str, value);
7226}
7227
7228// Parses a string for a string flag, in the form of
7229// "--flag=value".

Callers 1

ParseGoogleTestFlagFunction · 0.85

Calls 3

ParseFlagValueFunction · 0.85
ParseInt32Function · 0.85
MessageFunction · 0.70

Tested by

no test coverage detected