Means the stream ran out so we need to read more or return eof
| 65 | protected: |
| 66 | // Means the stream ran out so we need to read more or return eof |
| 67 | virtual int underflow() override { |
| 68 | // If we didn't ran out then simply return the value under the current |
| 69 | // pointer. |
| 70 | if (gptr() != egptr()) { |
| 71 | return *gptr(); |
| 72 | } else { |
| 73 | py::gil_scoped_acquire gil; |
| 74 | |
| 75 | // Ok we ran out so read buffer_size_ things into the buffer and reset |
| 76 | // the pointers. |
| 77 | int n_read = readinto_buffer(); |
| 78 | setg(buffer_, buffer_, buffer_ + n_read); |
| 79 | if (n_read > 0) { |
| 80 | return *gptr(); |
| 81 | } else { |
| 82 | return traits_type::eof(); |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | // Seek the underlying python "file" to the requested position. |
| 88 | virtual pos_type seekpos( |
nothing calls this directly
no outgoing calls
no test coverage detected