| 107 | : boundary_finder_(delimiter) {} |
| 108 | |
| 109 | Status Chunker::Process(std::shared_ptr<Buffer> block, std::shared_ptr<Buffer>* whole, |
| 110 | std::shared_ptr<Buffer>* partial) { |
| 111 | int64_t last_pos = -1; |
| 112 | RETURN_NOT_OK(boundary_finder_->FindLast(std::string_view(*block), &last_pos)); |
| 113 | if (last_pos == BoundaryFinder::kNoDelimiterFound) { |
| 114 | // No delimiter found |
| 115 | *whole = SliceBuffer(block, 0, 0); |
| 116 | *partial = block; |
| 117 | return Status::OK(); |
| 118 | } else { |
| 119 | *whole = SliceBuffer(block, 0, last_pos); |
| 120 | *partial = SliceBuffer(block, last_pos); |
| 121 | } |
| 122 | return Status::OK(); |
| 123 | } |
| 124 | |
| 125 | Status Chunker::ProcessWithPartial(std::shared_ptr<Buffer> partial, |
| 126 | std::shared_ptr<Buffer> block, |
nothing calls this directly
no test coverage detected