libzypp 17.35.1
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
27namespace 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
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 );
81 zypp::filesystem::Pathname deltaFile() const;
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
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition AutoDispose.h:95
Store and operate with byte count.
Definition ByteCount.h:32
Url manipulation class.
Definition Url.h:92
Holds transfer setting.
DownloadSpec(DownloadSpec &&) noexcept=default
const TransferSettings & settings() const
DownloadSpec & setUrl(const Url &url)
zypp::RWCOW_pointer< DownloadSpecPrivate > d_ptr
DownloadSpec(Url file, zypp::filesystem::Pathname targetPath, zypp::ByteCount expectedFileSize=zypp::ByteCount())
zypp::ByteCount preferredChunkSize() const
DownloadSpec(const DownloadSpec &other)=default
DownloadSpec & setDeltaFile(const zypp::Pathname &file)
DownloadSpec & setExpectedFileSize(const zypp::ByteCount &bc)
const std::optional< zypp::CheckSum > & headerChecksum() const
DownloadSpec & operator=(const DownloadSpec &other)=default
DownloadSpec & setCheckExistsOnly(bool set=true)
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
const Url & url() const
DownloadSpec & setTransferSettings(TransferSettings &&set)
DownloadSpec & setMetalinkEnabled(bool enable=true)
DownloadSpec & setTargetPath(const zypp::Pathname &path)
zypp::ByteCount expectedFileSize() const
bool metalinkEnabled() const
bool checkExistsOnly() const
DownloadSpec & setPreferredChunkSize(const zypp::ByteCount &bc)
Definition Arch.h:364
Easy-to use interface to the ZYPP dependency resolver.
zypp::media::TransferSettings TransferSettings
Definition downloader.h:25
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469
#define ZYPP_DECLARE_PRIVATE(Class)
Definition zyppglobal.h:87