| 336 | } |
| 337 | |
| 338 | bool ParseFeatures(protobuf::io::CodedInputStream* stream, |
| 339 | parsed::Example* example) { |
| 340 | DCHECK(stream != nullptr); |
| 341 | DCHECK(example != nullptr); |
| 342 | uint32 length; |
| 343 | if (!stream->ReadVarint32(&length)) return false; |
| 344 | auto limit = stream->PushLimit(length); |
| 345 | while (!stream->ExpectAtEnd()) { |
| 346 | parsed::FeatureMapEntry feature_map_entry; |
| 347 | if (!stream->ExpectTag(kDelimitedTag(1))) return false; |
| 348 | if (!ParseFeatureMapEntry(stream, &feature_map_entry)) return false; |
| 349 | example->push_back(std::move(feature_map_entry)); |
| 350 | } |
| 351 | stream->PopLimit(limit); |
| 352 | return true; |
| 353 | } |
| 354 | |
| 355 | bool ParseExample(protobuf::io::CodedInputStream* stream, |
| 356 | parsed::Example* example) { |
no test coverage detected