| 137 | */ |
| 138 | |
| 139 | int64_t GetFilePosition(std::streambuf& buffer) { |
| 140 | const auto pos = buffer.pubseekoff(0, std::ios_base::cur); |
| 141 | if (pos < 0) { |
| 142 | throw std::ios_base::failure("Failed to get a stream position"); |
| 143 | } |
| 144 | return pos; |
| 145 | } |
| 146 | |
| 147 | int64_t GetLastFilePosition(std::streambuf& buffer) { |
| 148 | const auto pos = buffer.pubseekoff(0, std::ios_base::end); |