libzypp  17.35.8
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 
18 #include <zypp-core/zyppng/core/Url>
19 #include <zypp-core/Pathname.h>
21 #include <zypp-core/ByteCount.h>
22 #include <zypp-core/CheckSum.h>
23 #include <zypp-curl/TransferSettings>
24 
25 #include <optional>
26 
27 namespace zyppng {
28 
29 
30  class DownloadSpecPrivate;
32 
38  {
40 
41  public:
44 
45  DownloadSpec( const DownloadSpec &other ) = default;
46  DownloadSpec &operator= ( const DownloadSpec &other ) = default;
47 
48  DownloadSpec(DownloadSpec &&) noexcept = default;
49  DownloadSpec &operator=(DownloadSpec &&) noexcept = default;
53  const Url &url () const;
54  DownloadSpec &setUrl ( const Url &url );
55 
59  const zypp::Pathname &targetPath() const;
60  DownloadSpec &setTargetPath ( const zypp::Pathname &path );
61 
67  DownloadSpec &setMetalinkEnabled ( bool enable = true );
68  bool metalinkEnabled ( ) const;
69 
73  DownloadSpec &setCheckExistsOnly ( bool set = true );
74  bool checkExistsOnly ( ) const;
75 
80  DownloadSpec &setDeltaFile ( const zypp::Pathname &file );
82 
91 
97  const TransferSettings &settings () const;
100 
103 
105  zypp::ByteCount headerSize() const;
106 
107  const std::optional<zypp::CheckSum> &headerChecksum () const;
109 
110  private:
112  };
113 
114 }
115 
116 #endif // ZYPPNG_MEDIA_NETWORK_DOWNLOADSPEC_H
DownloadSpec & setHeaderChecksum(const zypp::CheckSum &sum)
Store and operate with byte count.
Definition: ByteCount.h:31
Holds transfer setting.
DownloadSpec & setTransferSettings(TransferSettings &&set)
DownloadSpec & setPreferredChunkSize(const zypp::ByteCount &bc)
DownloadSpec & setTargetPath(const zypp::Pathname &path)
Definition: downloadspec.cc:64
bool metalinkEnabled() const
Definition: downloadspec.cc:76
zypp::filesystem::Pathname deltaFile() const
Definition: downloadspec.cc:98
DownloadSpec & setExpectedFileSize(const zypp::ByteCount &bc)
DownloadSpec & setDeltaFile(const zypp::Pathname &file)
Definition: downloadspec.cc:92
bool checkExistsOnly() const
Definition: downloadspec.cc:87
zypp::ByteCount preferredChunkSize() const
const std::optional< zypp::CheckSum > & headerChecksum() const
zypp::RWCOW_pointer< DownloadSpecPrivate > d_ptr
Definition: downloadspec.h:111
DownloadSpec & setUrl(const Url &url)
Definition: downloadspec.cc:53
const zypp::Pathname & targetPath() const
Definition: downloadspec.cc:59
zypp::ByteCount expectedFileSize() const
DownloadSpec & setMetalinkEnabled(bool enable=true)
Definition: downloadspec.cc:70
DownloadSpec(Url file, zypp::filesystem::Pathname targetPath, zypp::ByteCount expectedFileSize=zypp::ByteCount())
Definition: downloadspec.cc:40
#define ZYPP_DECLARE_PRIVATE(Class)
Definition: zyppglobal.h:87
const TransferSettings & settings() const
DownloadSpec & setHeaderSize(const zypp::ByteCount &bc)
zypp::ByteCount headerSize() const
const Url & url() const
Definition: downloadspec.cc:48
Url manipulation class.
Definition: Url.h:91
DownloadSpec & operator=(const DownloadSpec &other)=default
zypp::media::TransferSettings TransferSettings
Definition: downloader.h:25
DownloadSpec & setCheckExistsOnly(bool set=true)
Definition: downloadspec.cc:81
RW_pointer supporting &#39;copy on write&#39; functionality.
Definition: PtrTypes.h:468