azure-core
Public Member Functions | List of all members
Azure::Core::IO::ProgressBodyStream Class Reference

A concrete implementation of Azure::Core::IO::BodyStream that wraps another stream and reports progress.

#include <body_stream.hpp>

Inheritance diagram for Azure::Core::IO::ProgressBodyStream:
Azure::Core::IO::BodyStream

Public Member Functions

 ProgressBodyStream (BodyStream &bodyStream, std::function< void(int64_t bytesTransferred)> callback)
 Constructs ProgressBodyStream from a BodyStream. More...
 
void Rewind () override
 
int64_t Length () const override
 Get the length of the data. More...
 
- Public Member Functions inherited from Azure::Core::IO::BodyStream
virtual ~BodyStream ()=default
 Destructs BodyStream. More...
 
size_t Read (uint8_t *buffer, size_t count, Azure::Core::Context const &context=Azure::Core::Context())
 Read portion of data into a buffer. More...
 
size_t ReadToCount (uint8_t *buffer, size_t count, Azure::Core::Context const &context=Azure::Core::Context())
 Read Azure::Core::IO::BodyStream into a buffer until the buffer is filled, or until the stream is read to end. More...
 
std::vector< uint8_t > ReadToEnd (Azure::Core::Context const &context=Azure::Core::Context())
 Read Azure::Core::IO::BodyStream until the stream is read to end, allocating memory for the entirety of contents. More...
 

Constructor & Destructor Documentation

◆ ProgressBodyStream()

ProgressBodyStream::ProgressBodyStream ( BodyStream bodyStream,
std::function< void(int64_t bytesTransferred)>  callback 
)
Parameters
bodyStreamThe body stream to wrap.
callbackThe callback method used to report progress back to the caller.
Remarks
The Azure::Core::IO::ProgressBodyStream does not own the wrapped stream and is not responsible for closing / cleaning up resources.

Member Function Documentation

◆ Length()

int64_t ProgressBodyStream::Length ( ) const
overridevirtual
Remarks
Used with the HTTP Content-Length header.

Implements Azure::Core::IO::BodyStream.


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