MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ParseStringFlag

Function ParseStringFlag

tensorflow/core/util/command_line_flags.cc:30–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace {
29
30bool ParseStringFlag(tensorflow::StringPiece arg, tensorflow::StringPiece flag,
31 const std::function<bool(string)>& hook,
32 bool* value_parsing_ok) {
33 *value_parsing_ok = true;
34 if (absl::ConsumePrefix(&arg, "--") && absl::ConsumePrefix(&arg, flag) &&
35 absl::ConsumePrefix(&arg, "=")) {
36 *value_parsing_ok = hook(string(arg));
37 return true;
38 }
39
40 return false;
41}
42
43bool ParseInt32Flag(tensorflow::StringPiece arg, tensorflow::StringPiece flag,
44 const std::function<bool(int32)>& hook,

Callers 1

ParseMethod · 0.85

Calls 1

ConsumePrefixFunction · 0.50

Tested by

no test coverage detected