9#include <aws/io/stream.h>
29 Begin = AWS_SSB_BEGIN,
48 explicit operator bool() const noexcept {
return IsValid(); }
53 virtual bool IsValid() const noexcept = 0;
56 aws_input_stream *GetUnderlyingStream() noexcept {
return &m_underlying_stream; }
63 bool Read(
ByteBuf &dest) {
return aws_input_stream_read(&m_underlying_stream, &dest) == 0; }
73 return aws_input_stream_seek(&m_underlying_stream,
offset, (aws_stream_seek_basis)seekBasis) == 0;
83 return aws_input_stream_get_status(&m_underlying_stream, &status) == 0;
93 return aws_input_stream_get_length(&m_underlying_stream, &
length) == 0;
121 virtual int64_t GetLengthImpl() const noexcept = 0;
135 static
int s_Seek(aws_input_stream *stream, int64_t
offset, enum aws_stream_seek_basis basis);
136 static
int s_Read(aws_input_stream *stream, aws_byte_buf *dest);
137 static
int s_GetStatus(aws_input_stream *stream, aws_stream_status *status);
138 static
int s_GetLength(struct aws_input_stream *stream, int64_t *out_length);
139 static
void s_Destroy(struct aws_input_stream *stream);
141 static aws_input_stream_vtable s_vtable;
151 std::shared_ptr<Aws::Crt::Io::IStream> stream,
154 bool IsValid()
const noexcept override;
159 int64_t GetLengthImpl()
const noexcept override;
163 std::shared_ptr<Aws::Crt::Io::IStream> m_stream;
#define AWS_CRT_CPP_API
Definition: Exports.h:37
aws_stream_status StreamStatus
Definition: Stream.h:17
StreamSeekBasis
Definition: Stream.h:28
aws_off_t OffsetType
Definition: Stream.h:22
aws_allocator Allocator
Definition: StlAllocator.h:17
AWS_CRT_CPP_API Allocator * g_allocator
Definition: Api.cpp:23
aws_byte_buf ByteBuf
Definition: Types.h:32
buffer offset
Definition: cJSON.cpp:1128
char const int length
Definition: cJSON.h:181
char * buffer
Definition: cJSON.h:181