| 125 | class ParsingBoundaryFinder : public BoundaryFinder { |
| 126 | public: |
| 127 | Status FindFirst(string_view partial, string_view block, int64_t* out_pos) override { |
| 128 | auto length = ConsumeWholeObject(MultiStringStream({partial, block})); |
| 129 | if (length == string_view::npos) { |
| 130 | *out_pos = -1; |
| 131 | } else if (ARROW_PREDICT_FALSE(length < partial.size())) { |
| 132 | return Status::Invalid("JSON chunk error: invalid data at end of document"); |
| 133 | } else { |
| 134 | DCHECK_LE(length, partial.size() + block.size()); |
| 135 | *out_pos = static_cast<int64_t>(length - partial.size()); |
| 136 | } |
| 137 | return Status::OK(); |
| 138 | } |
| 139 | |
| 140 | Status FindLast(std::string_view block, int64_t* out_pos) override { |
| 141 | const size_t block_length = block.size(); |
nothing calls this directly
no test coverage detected