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

Function StartsWithFieldName

tensorflow/core/framework/op_gen_lib.cc:102–114  ·  view source on GitHub ↗

Does this line start with " :" where " " is in multi_line_fields? Sets *colon_pos to the position of the colon.

Source from the content-addressed store, hash-verified

100// Does this line start with "<spaces><field>:" where "<field>" is
101// in multi_line_fields? Sets *colon_pos to the position of the colon.
102static bool StartsWithFieldName(StringPiece line,
103 const std::vector<string>& multi_line_fields) {
104 StringPiece up_to_colon;
105 if (!SplitAt(':', &line, &up_to_colon)) return false;
106 while (absl::ConsumePrefix(&up_to_colon, " "))
107 ; // Remove leading spaces.
108 for (const auto& field : multi_line_fields) {
109 if (up_to_colon == field) {
110 return true;
111 }
112 }
113 return false;
114}
115
116static bool ConvertLine(StringPiece line,
117 const std::vector<string>& multi_line_fields,

Callers 1

ConvertLineFunction · 0.85

Calls 2

SplitAtFunction · 0.85
ConsumePrefixFunction · 0.50

Tested by

no test coverage detected