libzypp  17.31.31
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 
27 namespace zyppng {
28 
29 
30  class DownloadSpecPrivate;
32 
38  {
39  ZYPP_DECLARE_PRIVATE( DownloadSpec )
40 
41  public:
42 
44 
45  DownloadSpec( const DownloadSpec &other );
46  DownloadSpec &operator= ( const DownloadSpec &other );
47 
51  const Url &url () const;
52  DownloadSpec &setUrl ( const Url &url );
53 
57  const zypp::Pathname &targetPath() const;
58  DownloadSpec &setTargetPath ( const zypp::Pathname &path );
59 
65  DownloadSpec &setMetalinkEnabled ( bool enable = true );
66  bool metalinkEnabled ( ) const;
67 
71  DownloadSpec &setCheckExistsOnly ( bool set = true );
72  bool checkExistsOnly ( ) const;
73 
78  DownloadSpec &setDeltaFile ( const zypp::Pathname &file );
80 
89 
95  const TransferSettings &settings () const;
98 
101 
103  zypp::ByteCount headerSize() const;
104 
105  const std::optional<zypp::CheckSum> &headerChecksum () const;
107 
108  private:
110  };
111 
112 }
113 
114 #endif // ZYPPNG_MEDIA_NETWORK_DOWNLOADSPEC_H
DownloadSpec & setHeaderChecksum(const zypp::CheckSum &sum)
DownloadSpec & operator=(const DownloadSpec &other)
Store and operate with byte count.
Definition: ByteCount.h:30
Holds transfer setting.
DownloadSpec & setTransferSettings(TransferSettings &&set)
DownloadSpec & setPreferredChunkSize(const zypp::ByteCount &bc)
DownloadSpec & setTargetPath(const zypp::Pathname &path)
Definition: downloadspec.cc:66
bool metalinkEnabled() const
Definition: downloadspec.cc:78
zypp::filesystem::Pathname deltaFile() const
DownloadSpec & setExpectedFileSize(const zypp::ByteCount &bc)
DownloadSpec & setDeltaFile(const zypp::Pathname &file)
Definition: downloadspec.cc:94
bool checkExistsOnly() const
Definition: downloadspec.cc:89
zypp::ByteCount preferredChunkSize() const
const std::optional< zypp::CheckSum > & headerChecksum() const
zypp::RWCOW_pointer< DownloadSpecPrivate > d_ptr
Definition: downloadspec.h:109
DownloadSpec & setUrl(const Url &url)
Definition: downloadspec.cc:55
const zypp::Pathname & targetPath() const
Definition: downloadspec.cc:61
zypp::ByteCount expectedFileSize() const
DownloadSpec & setMetalinkEnabled(bool enable=true)
Definition: downloadspec.cc:72
DownloadSpec(Url file, zypp::filesystem::Pathname targetPath, zypp::ByteCount expectedFileSize=zypp::ByteCount())
Definition: downloadspec.cc:38
const TransferSettings & settings() const
DownloadSpec & setHeaderSize(const zypp::ByteCount &bc)
zypp::ByteCount headerSize() const
const Url & url() const
Definition: downloadspec.cc:50
zypp::media::TransferSettings TransferSettings
Definition: downloader.h:25
DownloadSpec & setCheckExistsOnly(bool set=true)
Definition: downloadspec.cc:83
RW_pointer supporting &#39;copy on write&#39; functionality.
Definition: PtrTypes.h:458