| 284 | |
| 285 | template <bool UseBulkFilter> |
| 286 | Status FindFirstInternal(std::string_view partial, std::string_view block, |
| 287 | int64_t* out_pos) { |
| 288 | const char* line_end = lexer_.template ReadLine<UseBulkFilter>( |
| 289 | partial.data(), partial.data() + partial.size()); |
| 290 | DCHECK_EQ(line_end, nullptr); // Otherwise `partial` is a whole CSV line |
| 291 | line_end = lexer_.template ReadLine<UseBulkFilter>(block.data(), |
| 292 | block.data() + block.size()); |
| 293 | |
| 294 | if (line_end == nullptr) { |
| 295 | // No complete CSV line |
| 296 | *out_pos = -1; |
| 297 | } else { |
| 298 | *out_pos = static_cast<int64_t>(line_end - block.data()); |
| 299 | DCHECK_GT(*out_pos, 0); |
| 300 | } |
| 301 | return Status::OK(); |
| 302 | } |
| 303 | |
| 304 | Status FindLast(std::string_view block, int64_t* out_pos) override { |
| 305 | lexer_.Reset(); |