roar
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Roar::Curl::FileSource Class Reference

#include <file_source.hpp>

Collaboration diagram for Roar::Curl::FileSource:

Public Member Functions

 FileSource (std::filesystem::path const &filename)
 
std::size_t fetch (char *buffer, std::size_t amount) override
 
std::size_t size () override
 
- Public Member Functions inherited from Roar::Curl::Source
virtual std::size_t fetch (char *buffer, std::size_t amount)=0
 
virtual std::size_t size ()=0
 
virtual bool isChunked () const
 
 Source ()=default
 
virtual ~Source ()=default
 
 Source (Source const &)=default
 
 Source (Source &&)=default
 
Sourceoperator= (Source const &)=default
 
Sourceoperator= (Source &&)=default
 

Private Attributes

std::ifstream reader_
 
std::optional< std::size_t > memoizedFileSize_
 

Constructor & Destructor Documentation

◆ FileSource()

Roar::Curl::FileSource::FileSource ( std::filesystem::path const &  filename)
explicit

Member Function Documentation

◆ fetch()

std::size_t Roar::Curl::FileSource::fetch ( char buffer,
std::size_t  amount 
)
overridevirtual

This function gets called when the upload requests more data.

Implements Roar::Curl::Source.

◆ size()

std::size_t Roar::Curl::FileSource::size ( )
overridevirtual

Returns the total size to upload. This function is unused if chunked encoding is used.

Implements Roar::Curl::Source.

Member Data Documentation

◆ memoizedFileSize_

std::optional<std::size_t> Roar::Curl::FileSource::memoizedFileSize_
private

◆ reader_

std::ifstream Roar::Curl::FileSource::reader_
private

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