| 1323 | } |
| 1324 | |
| 1325 | FORY_ALWAYS_INLINE bool fill_buffer(uint32_t min_fill_size, Error &error) { |
| 1326 | if (FORY_PREDICT_TRUE(min_fill_size <= size_ - reader_index_)) { |
| 1327 | return true; |
| 1328 | } |
| 1329 | if (FORY_PREDICT_TRUE(input_stream_ == nullptr)) { |
| 1330 | error.set_buffer_out_of_bound(reader_index_, min_fill_size, size_); |
| 1331 | return false; |
| 1332 | } |
| 1333 | auto fill_result = input_stream_->fill_buffer(min_fill_size); |
| 1334 | if (FORY_PREDICT_FALSE(!fill_result.ok())) { |
| 1335 | error = std::move(fill_result).error(); |
| 1336 | return false; |
| 1337 | } |
| 1338 | if (FORY_PREDICT_FALSE(min_fill_size > size_ - reader_index_)) { |
| 1339 | error.set_buffer_out_of_bound(reader_index_, min_fill_size, size_); |
| 1340 | return false; |
| 1341 | } |
| 1342 | return true; |
| 1343 | } |
| 1344 | |
| 1345 | FORY_ALWAYS_INLINE uint32_t read_var_uint32_slow(Error &error) { |
| 1346 | uint32_t position = reader_index_; |
nothing calls this directly
no test coverage detected