15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OBJECT_READ_STREAM_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OBJECT_READ_STREAM_H
18 #include "google/cloud/storage/headers_map.h"
19 #include "google/cloud/storage/internal/object_read_streambuf.h"
20 #include "google/cloud/storage/version.h"
46 : std::basic_istream<
char>(
nullptr), buf_(std::move(buf)) {
60 std::basic_istream<
char>::swap(rhs);
61 std::swap(buf_, rhs.buf_);
62 rhs.set_rdbuf(rhs.buf_.get());
63 set_rdbuf(buf_.get());
72 bool IsOpen()
const {
return static_cast<
bool>(buf_) && buf_->IsOpen(); }
135 HeadersMap
const&
headers()
const {
return buf_->headers(); }
157 return buf_->generation();
162 return buf_->metageneration();
167 return buf_->storage_class();
179 absl::optional<std::uint64_t>
const&
size()
const {
return buf_->size(); }
183 std::unique_ptr<internal::ObjectReadStreambuf> buf_;