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

Function ParseInt32Flag

rtpose_wrapper/src/gtest/gtest-all.cpp:5918–5928  ·  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

5916// On success, stores the value of the flag in *value, and returns
5917// true. On failure, returns false without changing *value.
5918bool ParseInt32Flag(const char* str, const char* flag, Int32* value) {
5919 // Gets the value of the flag as a string.
5920 const char* const value_str = ParseFlagValue(str, flag, false);
5921
5922 // Aborts if the parsing failed.
5923 if (value_str == NULL) return false;
5924
5925 // Sets *value to the value of the flag.
5926 return ParseInt32(Message() << "The value of flag --" << flag,
5927 value_str, value);
5928}
5929
5930// Parses a string for a string flag, in the form of
5931// "--flag=value".

Callers 1

Calls 3

ParseFlagValueFunction · 0.85
ParseInt32Function · 0.85
MessageFunction · 0.70

Tested by

no test coverage detected