libzypp  17.22.0
zyppng::DownloadPrivate::Request Struct Reference

#include <downloader_p.h>

Inheritance diagram for zyppng::DownloadPrivate::Request:

Public Types

using Ptr = std::shared_ptr< Request >
 
using WeakPtr = std::shared_ptr< Request >
 
- Public Types inherited from zyppng::NetworkRequest
enum  State { Pending, Running, Finished, Error }
 
enum  Priority { Normal, High }
 
enum  FileMode { WriteExclusive, WriteShared }
 
enum  OptionBits { HeadRequest = 0x01 }
 
using Ptr = std::shared_ptr< NetworkRequest >
 
using WeakPtr = std::weak_ptr< NetworkRequest >
 
- Public Types inherited from zyppng::Base
using Ptr = std::shared_ptr< Base >
 
using WeakPtr = std::weak_ptr< Base >
 

Public Member Functions

void connectSignals (DownloadPrivate &dl)
 
void disconnectSignals ()
 
 NetworkRequest (Url url, zypp::Pathname targetFile, off_t start=-1, off_t len=0, FileMode fMode=WriteExclusive)
 
- Public Member Functions inherited from zyppng::NetworkRequest
 ZYPP_DECLARE_FLAGS (Options, OptionBits)
 
 NetworkRequest (Url url, zypp::Pathname targetFile, off_t start=-1, off_t len=0, FileMode fMode=WriteExclusive)
 
virtual ~NetworkRequest ()
 
void setPriority (Priority prio)
 
Priority priority () const
 
void setOptions (Options opt)
 
Options options () const
 
void setRequestRange (off_t start=-1, off_t len=0)
 
const std::string & lastRedirectInfo () const
 
void * nativeHandle () const
 
std::vector< char > peekData (off_t offset, size_t count) const
 
Url url () const
 
void setUrl (const Url &url)
 This will change the URL of the request. More...
 
const zypp::PathnametargetFilePath () const
 Returns the target filename path. More...
 
std::string contentType () const
 Returns the content type as reported from the server. More...
 
off_t downloadOffset () const
 Returns the requested start offset. More...
 
off_t reportedByteCount () const
 Returns the number of bytes that are reported from the backend as the full download size, those can be 0 even when the download is already running. More...
 
off_t expectedByteCount () const
 Returns the expected byte count that was passed to the constructor, zero if none was given. More...
 
off_t downloadedByteCount () const
 Returns the number of already downloaded bytes as reported by the backend. More...
 
void setDigest (std::shared_ptr< zypp::Digest > dig)
 Set a. More...
 
std::shared_ptr< zypp::Digestdigest () const
 Returns the currently used. More...
 
void setExpectedChecksum (std::vector< unsigned char > checksum)
 Enables automated checking of downloaded contents against a checksum. More...
 
TransferSettingstransferSettings ()
 
State state () const
 Returns the current state the HttpDownloadRequest is in. More...
 
const NetworkRequestErrorerror () const
 Returns the last set Error. More...
 
std::string extendedErrorString () const
 In some cases curl can provide extended error informations collected at runtime. More...
 
bool hasError () const
 Checks if there was a error with the request. More...
 
bool addRequestHeader (const std::string &header)
 
SignalProxy< void(NetworkRequest &req)> sigStarted ()
 Signals that the dispatcher dequeued the request and actually starts downloading data. More...
 
SignalProxy< void(NetworkRequest &req, off_t dltotal, off_t dlnow, off_t ultotal, off_t ulnow)> sigProgress ()
 Signals if there was data read from the download. More...
 
SignalProxy< void(NetworkRequest &req, const NetworkRequestError &err)> sigFinished ()
 Signals that the download finished. More...
 
- Public Member Functions inherited from zyppng::Base
 Base ()
 
virtual ~Base ()
 
WeakPtr parent () const
 
void addChild (Base::Ptr child)
 
void removeChild (Ptr child)
 
const std::unordered_set< Ptr > & children () const
 
template<typename T >
std::vector< std::weak_ptr< T > > findChildren () const
 
template<typename T >
std::shared_ptr< T > shared_this () const
 
template<typename T >
std::shared_ptr< T > shared_this ()
 
template<typename T >
std::weak_ptr< T > weak_this () const
 
template<typename T >
std::weak_ptr< T > weak_this ()
 

Public Attributes

size_t _myBlock = -1
 
int _retryCount = 0
 
bool _triedCredFromStore = false
 
Url _originalUrl
 
connection _sigStartedConn
 
connection _sigProgressConn
 
connection _sigFinishedConn
 

Additional Inherited Members

- Protected Member Functions inherited from zyppng::Base
 Base (BasePrivate &dd)
 
- Protected Attributes inherited from zyppng::Base
std::unique_ptr< BasePrivated_ptr
 

Detailed Description

Definition at line 24 of file downloader_p.h.

Member Typedef Documentation

◆ Ptr

Definition at line 27 of file downloader_p.h.

◆ WeakPtr

Definition at line 28 of file downloader_p.h.

Member Function Documentation

◆ connectSignals()

void zyppng::DownloadPrivate::Request::connectSignals ( DownloadPrivate dl)

Definition at line 68 of file downloader.cc.

◆ disconnectSignals()

void zyppng::DownloadPrivate::Request::disconnectSignals ( )

Definition at line 75 of file downloader.cc.

◆ NetworkRequest()

zyppng::NetworkRequest::NetworkRequest
Parameters
urlThe source URL of the download
targetFileThe path where the file should be stored
startFile offset, if set this will create a range download request
lenFile range length
fModeThe mode in which the file is opened in.

Definition at line 486 of file request.cc.

Member Data Documentation

◆ _myBlock

size_t zyppng::DownloadPrivate::Request::_myBlock = -1

Definition at line 33 of file downloader_p.h.

◆ _retryCount

int zyppng::DownloadPrivate::Request::_retryCount = 0

Definition at line 34 of file downloader_p.h.

◆ _triedCredFromStore

bool zyppng::DownloadPrivate::Request::_triedCredFromStore = false

Definition at line 35 of file downloader_p.h.

◆ _originalUrl

Url zyppng::DownloadPrivate::Request::_originalUrl

Definition at line 36 of file downloader_p.h.

◆ _sigStartedConn

connection zyppng::DownloadPrivate::Request::_sigStartedConn

Definition at line 38 of file downloader_p.h.

◆ _sigProgressConn

connection zyppng::DownloadPrivate::Request::_sigProgressConn

Definition at line 39 of file downloader_p.h.

◆ _sigFinishedConn

connection zyppng::DownloadPrivate::Request::_sigFinishedConn

Definition at line 40 of file downloader_p.h.


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