|
libzypp
17.22.0
|
#include <request.h>

Public Types | |
| 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 | |
| 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::Pathname & | targetFilePath () 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::Digest > | digest () const |
| Returns the currently used. More... | |
| void | setExpectedChecksum (std::vector< unsigned char > checksum) |
| Enables automated checking of downloaded contents against a checksum. More... | |
| TransferSettings & | transferSettings () |
| State | state () const |
| Returns the current state the HttpDownloadRequest is in. More... | |
| const NetworkRequestError & | error () 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 () |
Friends | |
| class | NetworkRequestDispatcher |
| class | NetworkRequestDispatcherPrivate |
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 |
Represents a (http/https/ftp) request. This is the low level API for the
| using zyppng::NetworkRequest::Ptr = std::shared_ptr<NetworkRequest> |
| using zyppng::NetworkRequest::WeakPtr = std::weak_ptr<NetworkRequest> |
| zyppng::NetworkRequest::NetworkRequest | ( | zyppng::Url | url, |
| zypp::Pathname | targetFile, | ||
| off_t | start = -1, |
||
| off_t | len = 0, |
||
| FileMode | fMode = WriteExclusive |
||
| ) |
| url | The source URL of the download |
| targetFile | The path where the file should be stored |
| start | File offset, if set this will create a range download request |
| len | File range length |
| fMode | The mode in which the file is opened in. |
Definition at line 486 of file request.cc.
|
virtual |
Definition at line 491 of file request.cc.
| zyppng::NetworkRequest::ZYPP_DECLARE_FLAGS | ( | Options | , |
| OptionBits | |||
| ) |
| void zyppng::NetworkRequest::setPriority | ( | NetworkRequest::Priority | prio | ) |
Sets the priority of the NetworkRequest, this will affect where the
Definition at line 502 of file request.cc.
| NetworkRequest::Priority zyppng::NetworkRequest::priority | ( | ) | const |
Returns the requested priority of the NetworkRequest
Definition at line 507 of file request.cc.
| void zyppng::NetworkRequest::setOptions | ( | Options | opt | ) |
Change request options, currently only the
Definition at line 512 of file request.cc.
| NetworkRequest::Options zyppng::NetworkRequest::options | ( | ) | const |
Returns the currently set options
Definition at line 517 of file request.cc.
| void zyppng::NetworkRequest::setRequestRange | ( | off_t | start = -1, |
| off_t | len = 0 |
||
| ) |
Sets the range description
| start | |
| len |
Definition at line 522 of file request.cc.
| const std::string & zyppng::NetworkRequest::lastRedirectInfo | ( | ) | const |
Returns the last redirect information from the headers.
Definition at line 531 of file request.cc.
| void * zyppng::NetworkRequest::nativeHandle | ( | ) | const |
Returns a pointer to the native CURL easy handle
Definition at line 536 of file request.cc.
| std::vector< char > zyppng::NetworkRequest::peekData | ( | off_t | offset, |
| size_t | count | ||
| ) | const |
Will return the data at offset with length count. If there is not yet enough data a empty vector will be returned
Definition at line 541 of file request.cc.
| Url zyppng::NetworkRequest::url | ( | ) | const |
Returns the request URL
Definition at line 547 of file request.cc.
| void zyppng::NetworkRequest::setUrl | ( | const Url & | url | ) |
This will change the URL of the request.
Definition at line 552 of file request.cc.
| const zypp::filesystem::Pathname & zyppng::NetworkRequest::targetFilePath | ( | ) | const |
Returns the target filename path.
Definition at line 561 of file request.cc.
| std::string zyppng::NetworkRequest::contentType | ( | ) | const |
Returns the content type as reported from the server.
Definition at line 566 of file request.cc.
| off_t zyppng::NetworkRequest::downloadOffset | ( | ) | const |
Returns the requested start offset.
Definition at line 574 of file request.cc.
| off_t zyppng::NetworkRequest::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.
Definition at line 579 of file request.cc.
| off_t zyppng::NetworkRequest::expectedByteCount | ( | ) | const |
Returns the expected byte count that was passed to the constructor, zero if none was given.
Definition at line 584 of file request.cc.
| off_t zyppng::NetworkRequest::downloadedByteCount | ( | ) | const |
Returns the number of already downloaded bytes as reported by the backend.
Definition at line 589 of file request.cc.
| void zyppng::NetworkRequest::setDigest | ( | std::shared_ptr< zypp::Digest > | dig | ) |
Set a.
Definition at line 597 of file request.cc.
| std::shared_ptr< zypp::Digest > zyppng::NetworkRequest::digest | ( | ) | const |
Returns the currently used.
Definition at line 612 of file request.cc.
| void zyppng::NetworkRequest::setExpectedChecksum | ( | std::vector< unsigned char > | checksum | ) |
Enables automated checking of downloaded contents against a checksum.
Only makes a difference if a
Definition at line 602 of file request.cc.
| TransferSettings & zyppng::NetworkRequest::transferSettings | ( | ) |
Returns a writeable reference to the internal
Definition at line 607 of file request.cc.
| NetworkRequest::State zyppng::NetworkRequest::state | ( | ) | const |
Returns the current state the HttpDownloadRequest is in.
Definition at line 617 of file request.cc.
| const NetworkRequestError & zyppng::NetworkRequest::error | ( | ) | const |
Returns the last set Error.
Definition at line 622 of file request.cc.
| std::string zyppng::NetworkRequest::extendedErrorString | ( | ) | const |
In some cases curl can provide extended error informations collected at runtime.
In those cases its possible to query that information.
Definition at line 627 of file request.cc.
| bool zyppng::NetworkRequest::hasError | ( | ) | const |
Checks if there was a error with the request.
Definition at line 636 of file request.cc.
| bool zyppng::NetworkRequest::addRequestHeader | ( | const std::string & | header | ) |
Adds a raw header to the request data. Use this to send custom headers to the server.
Definition at line 641 of file request.cc.
| SignalProxy< void(NetworkRequest &req)> zyppng::NetworkRequest::sigStarted | ( | ) |
Signals that the dispatcher dequeued the request and actually starts downloading data.
Definition at line 655 of file request.cc.
| SignalProxy< void(NetworkRequest &req, off_t dltotal, off_t dlnow, off_t ultotal, off_t ulnow)> zyppng::NetworkRequest::sigProgress | ( | ) |
Signals if there was data read from the download.
Definition at line 660 of file request.cc.
| SignalProxy< void(zyppng::NetworkRequest &req, const zyppng::NetworkRequestError &err)> zyppng::NetworkRequest::sigFinished | ( | ) |
Signals that the download finished.
Definition at line 665 of file request.cc.
|
friend |