libzypp  17.22.0
zyppng::Downloader Class Reference

The Downloader class. More...

#include <downloader.h>

Inheritance diagram for zyppng::Downloader:

Public Types

using Ptr = std::shared_ptr< Downloader >
 
using WeakPtr = std::shared_ptr< Downloader >
 
- Public Types inherited from zyppng::Base
using Ptr = std::shared_ptr< Base >
 
using WeakPtr = std::weak_ptr< Base >
 

Public Member Functions

 Downloader ()
 
std::shared_ptr< DownloaddownloadFile (Url file, zypp::filesystem::Pathname targetPath, zypp::ByteCount expectedFileSize=zypp::ByteCount())
 
std::shared_ptr< NetworkRequestDispatcher > requestDispatcher () const
 
SignalProxy< void(Downloader &parent, Download &download)> sigStarted ()
 
SignalProxy< void(Downloader &parent, Download &download)> sigFinished ()
 
SignalProxy< void(Downloader &parent)> queueEmpty ()
 
- 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 ()
 

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

The Downloader class.

Provides a high level interface to the

See also
HttpRequestDispatcher, implementing Metalink on top. If in doubt which one to use, always use this one.

Definition at line 34 of file downloader.h.

Member Typedef Documentation

◆ Ptr

using zyppng::Downloader::Ptr = std::shared_ptr<Downloader>

Definition at line 39 of file downloader.h.

◆ WeakPtr

using zyppng::Downloader::WeakPtr = std::shared_ptr<Downloader>

Definition at line 40 of file downloader.h.

Constructor & Destructor Documentation

◆ Downloader()

zyppng::Downloader::Downloader ( )

Definition at line 805 of file downloader.cc.

Member Function Documentation

◆ downloadFile()

std::shared_ptr< Download > zyppng::Downloader::downloadFile ( zyppng::Url  file,
zypp::filesystem::Pathname  targetPath,
zypp::ByteCount  expectedFileSize = zypp::ByteCount() 
)

Generates a new Download object in waiting state

Parameters
filethe
See also
zyppng::Url to the source file that should be downloaded
Parameters
targetPaththe local file path where the downloaded file needs to be stored
expectedFileSizeThe expected file size of the source file, can be empty

Definition at line 811 of file downloader.cc.

◆ requestDispatcher()

std::shared_ptr< NetworkRequestDispatcher > zyppng::Downloader::requestDispatcher ( ) const

Returns the internally used

See also
zyppng::NetworkRequestDispatcher used by the Downloader to enqueue network requests

Definition at line 824 of file downloader.cc.

◆ sigStarted()

SignalProxy< void(Downloader &parent, Download &download)> zyppng::Downloader::sigStarted ( )

Emitted when a

See also
zyppng::Download created by this Downloader instance was started

Definition at line 829 of file downloader.cc.

◆ sigFinished()

SignalProxy< void(Downloader &parent, Download &download)> zyppng::Downloader::sigFinished ( )

Signal that is emitted when a

See also
zyppng::Download created by this Downloader instance was finished
Note
Just as with
See also
zyppng::NetworkRequest 's the finished signal does not mean the Download was successful

Definition at line 834 of file downloader.cc.

◆ queueEmpty()

SignalProxy< void(Downloader &parent)> zyppng::Downloader::queueEmpty ( )

Signal is always emitted when there are not Downloads anymore waiting in the queue

Definition at line 839 of file downloader.cc.


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