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

Function GetValue

tensorflow/core/platform/platform_strings_test.cc:60–72  ·  view source on GitHub ↗

Return whether str[] conatins a string with prefix "macro_name="; if so, set *pvalue to the suffix.

Source from the content-addressed store, hash-verified

58// Return whether str[] conatins a string with prefix "macro_name="; if so,
59// set *pvalue to the suffix.
60static bool GetValue(const string_vec &str, const std::string &macro_name,
61 std::string *pvalue) {
62 std::string nam_eq = macro_name + "=";
63 int i = 0;
64 while (i != str.size() && !absl::StartsWith(str[i], nam_eq)) {
65 i++;
66 }
67 bool found = (i != str.size());
68 if (found) {
69 *pvalue = str[i].substr(nam_eq.size());
70 }
71 return found;
72}
73
74// If macro_name[] is not equal to value[], check that str[] contains the
75// string "macro_name=value". Otherwise, check that str[] does not contain any

Callers 1

CheckStrFunction · 0.70

Calls 2

StartsWithFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected