10 #include <aws/io/stream.h>
30 Begin = AWS_SSB_BEGIN,
50 explicit operator bool() const noexcept {
return IsValid(); }
55 virtual bool IsValid() const noexcept = 0;
58 aws_input_stream *GetUnderlyingStream() noexcept {
return &m_underlying_stream; }
65 bool Read(
ByteBuf &dest) {
return aws_input_stream_read(&m_underlying_stream, &dest) == 0; }
75 return aws_input_stream_seek(&m_underlying_stream, offset, (aws_stream_seek_basis)seekBasis) == 0;
85 return aws_input_stream_get_status(&m_underlying_stream, &status) == 0;
95 return aws_input_stream_get_length(&m_underlying_stream, &length) == 0;
126 virtual int64_t GetLengthImpl() const noexcept = 0;
140 static
int s_Seek(aws_input_stream *stream, int64_t offset, enum aws_stream_seek_basis basis);
141 static
int s_Read(aws_input_stream *stream, aws_byte_buf *dest);
142 static
int s_GetStatus(aws_input_stream *stream, aws_stream_status *status);
143 static
int s_GetLength(struct aws_input_stream *stream, int64_t *out_length);
144 static
void s_Acquire(aws_input_stream *stream);
145 static
void s_Release(aws_input_stream *stream);
147 static aws_input_stream_vtable s_vtable;
157 std::shared_ptr<Aws::Crt::Io::IStream> stream,
160 bool IsValid()
const noexcept
override;
163 bool ReadImpl(
ByteBuf &buffer) noexcept
override;
165 int64_t GetLengthImpl()
const noexcept
override;
169 std::shared_ptr<Aws::Crt::Io::IStream> m_stream;