| 56 | CASCStream::pos_type CASCStream::seekpos(pos_type pos, std::ios_base::openmode which) { return seekoff(pos, std::ios_base::beg, which); } |
| 57 | |
| 58 | CASCStream::pos_type CASCStream::seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode) { |
| 59 | std::streamsize newPos = 0; |
| 60 | switch (dir) { |
| 61 | case std::ios_base::beg: |
| 62 | newPos = off; |
| 63 | break; |
| 64 | case std::ios_base::cur: |
| 65 | newPos = _startOfBlock + (gptr() - eback()) + off; |
| 66 | break; |
| 67 | case std::ios_base::end: |
| 68 | newPos = size() + off; |
| 69 | break; |
| 70 | default: |
| 71 | break; |
| 72 | } |
| 73 | if (newPos >= _startOfBlock && newPos < _startOfBlock + (egptr() - eback())) { |
| 74 | // The new position is already in the buffer, just repoint the pointer to it |
| 75 | setg(eback(), eback() + newPos - _startOfBlock, egptr()); |
| 76 | } else { |
| 77 | // Drop buffer, it will be read in underflow |
| 78 | CascSetFilePointer64(_file, newPos, nullptr, 0); |
| 79 | setg(nullptr, nullptr, nullptr); |
| 80 | _startOfBlock = newPos; |
| 81 | } |
| 82 | return _startOfBlock + (gptr() - eback()); |
| 83 | } |
| 84 | |
| 85 | std::streamsize CASCStream::size() const { |
| 86 | ULONGLONG ulongsize; |
nothing calls this directly
no outgoing calls
no test coverage detected