libzypp 17.31.23
downloadspec.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------/
9*
10* This file contains private API, this might break at any time between releases.
11* You have been warned!
12*
13*/
14#ifndef ZYPPNG_MEDIA_NETWORK_DOWNLOADSPEC_H
15#define ZYPPNG_MEDIA_NETWORK_DOWNLOADSPEC_H
16
17#include <zypp-core/zyppng/base/zyppglobal.h>
18#include <zypp-core/zyppng/core/Url>
19#include <zypp-core/Pathname.h>
20#include <zypp-core/base/PtrTypes.h>
21#include <zypp-core/ByteCount.h>
22#include <zypp-core/CheckSum.h>
23#include <zypp-curl/TransferSettings>
24
25#include <optional>
26
27namespace zyppng {
28
29
30 class DownloadSpecPrivate;
32
38 {
39 ZYPP_DECLARE_PRIVATE( DownloadSpec )
40
41 public:
42
44
45 DownloadSpec( const DownloadSpec &other );
47
51 const Url &url () const;
52 DownloadSpec &setUrl ( const Url &url );
53
57 const zypp::Pathname &targetPath() const;
59
65 DownloadSpec &setMetalinkEnabled ( bool enable = true );
66 bool metalinkEnabled ( ) const;
67
71 DownloadSpec &setCheckExistsOnly ( bool set = true );
72 bool checkExistsOnly ( ) const;
73
80
89
95 const TransferSettings &settings () const;
98
101
104
105 const std::optional<zypp::CheckSum> &headerChecksum () const;
107
108 private:
110 };
111
112}
113
114#endif // ZYPPNG_MEDIA_NETWORK_DOWNLOADSPEC_H
Store and operate with byte count.
Definition: ByteCount.h:31
Holds transfer setting.
const TransferSettings & settings() const
DownloadSpec & setUrl(const Url &url)
Definition: downloadspec.cc:55
zypp::RWCOW_pointer< DownloadSpecPrivate > d_ptr
Definition: downloadspec.h:109
DownloadSpec(const DownloadSpec &other)
zypp::ByteCount preferredChunkSize() const
DownloadSpec & operator=(const DownloadSpec &other)
DownloadSpec & setDeltaFile(const zypp::Pathname &file)
Definition: downloadspec.cc:94
DownloadSpec & setExpectedFileSize(const zypp::ByteCount &bc)
const std::optional< zypp::CheckSum > & headerChecksum() const
DownloadSpec & setCheckExistsOnly(bool set=true)
Definition: downloadspec.cc:83
zypp::ByteCount headerSize() const
zypp::filesystem::Pathname deltaFile() const
DownloadSpec & setHeaderChecksum(const zypp::CheckSum &sum)
DownloadSpec & setHeaderSize(const zypp::ByteCount &bc)
const zypp::Pathname & targetPath() const
Definition: downloadspec.cc:61
const Url & url() const
Definition: downloadspec.cc:50
DownloadSpec & setTransferSettings(TransferSettings &&set)
DownloadSpec & setMetalinkEnabled(bool enable=true)
Definition: downloadspec.cc:72
DownloadSpec & setTargetPath(const zypp::Pathname &path)
Definition: downloadspec.cc:66
zypp::ByteCount expectedFileSize() const
bool metalinkEnabled() const
Definition: downloadspec.cc:78
bool checkExistsOnly() const
Definition: downloadspec.cc:89
DownloadSpec & setPreferredChunkSize(const zypp::ByteCount &bc)
zypp::media::TransferSettings TransferSettings
Definition: downloader.h:25
RW_pointer supporting 'copy on write' functionality.
Definition: PtrTypes.h:459