AWS IoT Device SDK C++ v2: Aws::Crt::Io::InputStream Class Reference

AWS IoT Device SDK C++ v2 1.14.0 AWS IoT Device SDK C++ v2

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Aws::Crt::Io::InputStream Class Referenceabstract

`#include <Stream.h>`

Inheritance diagram for Aws::Crt::Io::InputStream:

## Public Member Functions
virtual | ~InputStream ()
| InputStream (const InputStream &)=delete
InputStream & | operator= (const InputStream &)=delete
| InputStream (InputStream &&)=delete
InputStream & | operator= (InputStream &&)=delete
| operator bool () const noexcept
virtual bool | IsValid () const noexcept=0
bool | Read (ByteBuf &dest)
bool | Seek (int64_t offset, StreamSeekBasis seekBasis)
bool | GetStatus (StreamStatus &status)
bool | GetLength (int64_t &length)

## Protected Member Functions
| InputStream (Aws::Crt::Allocator *allocator=g_allocator)
virtual bool | ReadImpl (ByteBuf &buffer) noexcept=0
virtual StreamStatus | GetStatusImpl () const noexcept=0
virtual int64_t | GetLengthImpl () const noexcept=0
virtual bool | SeekImpl (int64_t offset, StreamSeekBasis seekBasis) noexcept=0

## Protected Attributes
Allocator * | m_allocator
aws_input_stream | m_underlying_stream

## Constructor & Destructor Documentation

## ◆ ~InputStream()

Aws::Crt::Io::InputStream::~InputStream | ( |  | ) |
| virtual

## ◆ InputStream() [1/3]

Aws::Crt::Io::InputStream::InputStream | ( | const InputStream & |  | ) |
| delete

## ◆ InputStream() [2/3]

Aws::Crt::Io::InputStream::InputStream | ( | InputStream && |  | ) |
| delete

## ◆ InputStream() [3/3]

Aws::Crt::Io::InputStream::InputStream | ( | Aws::Crt::Allocator * | allocator = `g_allocator` | ) |
| protected

## Member Function Documentation

## ◆ GetLength()

bool Aws::Crt::Io::InputStream::GetLength | ( | int64_t & | length | ) |
| inline

Gets the stream's length. Some streams may not be able to answer this.

Parameters

  length | output parameter for the length of the stream

Returns
  success/failure

## ◆ GetLengthImpl()

virtual int64_t Aws::Crt::Io::InputStream::GetLengthImpl | ( |  | ) | const
| protectedpure virtualnoexcept

Returns
  the total length of the available data for the stream.
  -1 if not available.

Implemented in Aws::Crt::Io::StdIOStreamInputStream.

## ◆ GetStatus()

bool Aws::Crt::Io::InputStream::GetStatus | ( | StreamStatus & | status | ) |
| inline

Gets the stream's current status

Parameters

  status | output parameter for the stream's status

Returns
  success/failure

## ◆ GetStatusImpl()

virtual StreamStatus Aws::Crt::Io::InputStream::GetStatusImpl | ( |  | ) | const
| protectedpure virtualnoexcept

Returns
  the current status of the stream.

Implemented in Aws::Crt::Io::StdIOStreamInputStream.

## ◆ IsValid()

virtual bool Aws::Crt::Io::InputStream::IsValid | ( |  | ) | const
| pure virtualnoexcept

Returns
  true/false if this object is in a valid state

Implemented in Aws::Crt::Io::StdIOStreamInputStream.

## ◆ operator bool()

Aws::Crt::Io::InputStream::operator bool | ( |  | ) | const
| inlineexplicitnoexcept

## ◆ operator=() [1/2]

InputStream & Aws::Crt::Io::InputStream::operator= | ( | const InputStream & |  | ) |
| delete

## ◆ operator=() [2/2]

InputStream & Aws::Crt::Io::InputStream::operator= | ( | InputStream && |  | ) |
| delete

## ◆ Read()

bool Aws::Crt::Io::InputStream::Read | ( | ByteBuf & | dest | ) |
| inline

Reads data from the stream into a buffer

Parameters

  dest | buffer to add the read data into

Returns
  success/failure

## ◆ ReadImpl()

virtual bool Aws::Crt::Io::InputStream::ReadImpl | ( | ByteBuf & | buffer | ) |
| protectedpure virtualnoexcept

Implemented in Aws::Crt::Io::StdIOStreamInputStream.

## ◆ Seek()

bool Aws::Crt::Io::InputStream::Seek | ( | int64_t | offset,
|  | StreamSeekBasis | seekBasis
| ) |  |
| inline

Moves the head of the stream to a new location

Parameters

  offset | how far to move, in bytes
  seekBasis | what direction to move the head of stream

Returns
  success/failure

## ◆ SeekImpl()

virtual bool Aws::Crt::Io::InputStream::SeekImpl | ( | int64_t | offset,
|  | StreamSeekBasis | seekBasis
| ) |  |
| protectedpure virtualnoexcept

Seek's the stream to seekBasis based offset bytes.

It is expected, that if seeking to the beginning of a stream, all error's are cleared if possible.

Returns
  true on success, false otherwise. You SHOULD raise an error via aws_raise_error() if a failure occurs.

## Member Data Documentation

## ◆ m_allocator

Allocator* Aws::Crt::Io::InputStream::m_allocator
| protected

## ◆ m_underlying_stream

aws_input_stream Aws::Crt::Io::InputStream::m_underlying_stream
| protected

The documentation for this class was generated from the following files:

- crt/aws-crt-cpp/include/aws/crt/io/Stream.h
- crt/aws-crt-cpp/source/io/Stream.cpp