21 StreamView(std::shared_ptr<std::istream> stream):
24 auto g = stream_->tellg();
25 stream_->seekg(0, std::ios_base::end);
26 stream_size_ = stream_->tellg();
27 stream_->seekg(g, std::ios_base::beg);
30 StreamView& seekg(std::streamoff pos, std::ios_base::seekdir way) {
31 if(way == std::ios_base::beg) {
33 }
else if(way == std::ios_base::cur) {
36 cursor_ = stream_size_ - pos;
43 auto g = stream_->tellg();
45 stream_->seekg(cursor_);
54 std::shared_ptr<std::istream> stream_;
55 std::streampos cursor_;
56 std::size_t stream_size_;