|
libzypp
17.22.0
|
#include <downloader.h>

Public Types | |
| enum | State { InitialState, Initializing = 10, Running = 20, RunningMulti = 30, Success = 200, Failed } |
| using | Ptr = std::shared_ptr< Download > |
| using | WeakPtr = std::shared_ptr< Download > |
Public Types inherited from zyppng::Base | |
| using | Ptr = std::shared_ptr< Base > |
| using | WeakPtr = std::weak_ptr< Base > |
Public Member Functions | |
| Download (DownloadPrivate &&prv) | |
| Url | url () const |
| zypp::Pathname | targetPath () const |
| State | state () const |
| NetworkRequestError | lastRequestError () const |
| std::string | errorString () const |
| TransferSettings & | settings () |
| void | start () |
| void | setMultiPartHandlingEnabled (bool enable=true) |
| void | setCheckExistsOnly (bool set=true) |
| void | setDeltaFile (const zypp::Pathname &file) |
| NetworkRequestDispatcher & | dispatcher () const |
| SignalProxy< void(Download &req)> | sigStarted () |
| SignalProxy< void(Download &req, State state)> | sigStateChanged () |
| SignalProxy< void(Download &req, off_t dlnow)> | sigAlive () |
| SignalProxy< void(Download &req, off_t dltotal, off_t dlnow)> | sigProgress () |
| SignalProxy< void(Download &req)> | sigFinished () |
| SignalProxy< void(Download &req, NetworkAuthData &auth, const std::string &availAuth)> | sigAuthRequired () |
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< BasePrivate > | d_ptr |
The Download class represents a possibly multipart download.
The Download class is a more high level interface compared to
Definition at line 123 of file downloader.h.
| using zyppng::Download::Ptr = std::shared_ptr<Download> |
Definition at line 129 of file downloader.h.
| using zyppng::Download::WeakPtr = std::shared_ptr<Download> |
Definition at line 130 of file downloader.h.
The states of the internal state machine. Each of them represents a different stage of the lifetime of a Download.
| Enumerator | |
|---|---|
| InitialState | |
| Initializing | |
| Running | |
| RunningMulti | |
| Success | |
| Failed | |
Definition at line 136 of file downloader.h.
| zyppng::Download::Download | ( | zyppng::DownloadPrivate && | prv | ) |
A download can only directly be created by the
Definition at line 678 of file downloader.cc.
| Url zyppng::Download::url | ( | ) | const |
Returns the source URL of the download
Definition at line 682 of file downloader.cc.
| zypp::filesystem::Pathname zyppng::Download::targetPath | ( | ) | const |
Returns the target file path, this is where the downloaded data is stored
Definition at line 687 of file downloader.cc.
| Download::State zyppng::Download::state | ( | ) | const |
Returns the current internal state of the Download
Definition at line 692 of file downloader.cc.
| NetworkRequestError zyppng::Download::lastRequestError | ( | ) | const |
Returns the last
Definition at line 697 of file downloader.cc.
| std::string zyppng::Download::errorString | ( | ) | const |
Returns a readable reason why the download failed.
Definition at line 702 of file downloader.cc.
| TransferSettings & zyppng::Download::settings | ( | ) |
Returns a writeable reference to the
Definition at line 712 of file downloader.cc.
| void zyppng::Download::start | ( | ) |
Triggers the start of the download, this needs to be called in order for the statemachine to advance.
Definition at line 717 of file downloader.cc.
| void zyppng::Download::setMultiPartHandlingEnabled | ( | bool | enable = true | ) |
Enabled or disabled multipart handling. Enabled by default.
Definition at line 722 of file downloader.cc.
| void zyppng::Download::setCheckExistsOnly | ( | bool | set = true | ) |
Enables a special mode, in this case only the existance of the file is checked but no data is actually downloaded
Definition at line 727 of file downloader.cc.
| void zyppng::Download::setDeltaFile | ( | const zypp::Pathname & | file | ) |
Set a already existing local file to be used for partial downloading, in case of a multichunk download all chunks from the file that have the expected checksum will be reused instead of downloaded
Definition at line 737 of file downloader.cc.
| zyppng::NetworkRequestDispatcher & zyppng::Download::dispatcher | ( | ) | const |
Returns a reference to the internally used
Definition at line 742 of file downloader.cc.
| SignalProxy< void(Download &req)> zyppng::Download::sigStarted | ( | ) |
Signals that the dispatcher dequeued the request and actually starts downloading data
Definition at line 747 of file downloader.cc.
| SignalProxy< void(Download &req, Download::State state)> zyppng::Download::sigStateChanged | ( | ) |
Signals that the state of the Download has changed
Definition at line 752 of file downloader.cc.
| SignalProxy< void(zyppng::Download &req, off_t dlnow)> zyppng::Download::sigAlive | ( | ) |
Signals that the download is alive but still in initial stage ( trying to figure out if metalink / zsync )
Definition at line 757 of file downloader.cc.
| SignalProxy< void(Download &req, off_t dltotal, off_t dlnow)> zyppng::Download::sigProgress | ( | ) |
Signals if there was data read from the download
Definition at line 762 of file downloader.cc.
| SignalProxy< void(Download &req)> zyppng::Download::sigFinished | ( | ) |
Signals that the download finished.
Definition at line 767 of file downloader.cc.
| SignalProxy< void(zyppng::Download &req, zyppng::NetworkAuthData &auth, const std::string &availAuth)> zyppng::Download::sigAuthRequired | ( | ) |
Is emitted when a request requires authentication and it was not given or if auth failed. A connected slot should fill in the auth information in order to provide login credentials.
Definition at line 772 of file downloader.cc.