AWS SDK for C++  1.9.159
AWS SDK for C++
Public Member Functions | Protected Member Functions | List of all members
Aws::Utils::Stream::PreallocatedStreamBuf Class Reference

#include <PreallocatedStreamBuf.h>

+ Inheritance diagram for Aws::Utils::Stream::PreallocatedStreamBuf:

Public Member Functions

 PreallocatedStreamBuf (unsigned char *buffer, uint64_t lengthToRead)
 PreallocatedStreamBuf (const PreallocatedStreamBuf &)=delete
PreallocatedStreamBufoperator= (const PreallocatedStreamBuf &)=delete
 PreallocatedStreamBuf (PreallocatedStreamBuf &&toMove)=delete
PreallocatedStreamBufoperator= (PreallocatedStreamBuf &&)=delete
unsigned char * GetBuffer ()

Protected Member Functions

pos_type seekoff (off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) override
pos_type seekpos (pos_type pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) override

Detailed Description

this is a stream buf to use with std::iostream that uses a preallocated buffer under the hood.

Definition at line 22 of file PreallocatedStreamBuf.h.

Constructor & Destructor Documentation

◆ PreallocatedStreamBuf() [1/3]

Aws::Utils::Stream::PreallocatedStreamBuf::PreallocatedStreamBuf ( unsigned char *  buffer,
uint64_t  lengthToRead 

Initialize the stream buffer with a pointer to your buffer. This class never takes ownership of the buffer. It is your responsibility to delete it once the stream is no longer in use.

bufferbuffer to initialize from.
lengthToReadlength in bytes to actually use in the buffer (e.g. you have a 1kb buffer, but only want the stream to see 500 b of it.

◆ PreallocatedStreamBuf() [2/3]

Aws::Utils::Stream::PreallocatedStreamBuf::PreallocatedStreamBuf ( const PreallocatedStreamBuf )

◆ PreallocatedStreamBuf() [3/3]

Aws::Utils::Stream::PreallocatedStreamBuf::PreallocatedStreamBuf ( PreallocatedStreamBuf &&  toMove)

Member Function Documentation

◆ GetBuffer()

unsigned char* Aws::Utils::Stream::PreallocatedStreamBuf::GetBuffer ( )

Get the buffer that is being used by the stream buffer.

Pointer to the underlying buffer (probably for a Aws::Delete() call).

Definition at line 44 of file PreallocatedStreamBuf.h.

◆ operator=() [1/2]

PreallocatedStreamBuf& Aws::Utils::Stream::PreallocatedStreamBuf::operator= ( const PreallocatedStreamBuf )

◆ operator=() [2/2]

PreallocatedStreamBuf& Aws::Utils::Stream::PreallocatedStreamBuf::operator= ( PreallocatedStreamBuf &&  )

◆ seekoff()

pos_type Aws::Utils::Stream::PreallocatedStreamBuf::seekoff ( off_type  off,
std::ios_base::seekdir  dir,
std::ios_base::openmode  which = std::ios_base::in|std::ios_base::out 

◆ seekpos()

pos_type Aws::Utils::Stream::PreallocatedStreamBuf::seekpos ( pos_type  pos,
std::ios_base::openmode  which = std::ios_base::in|std::ios_base::out 

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