libzypp  17.35.8
zyppng::DownloadSpec Class Reference

#include <zypp-curl/ng/network/downloadspec.h>

Public Member Functions

 DownloadSpec (Url file, zypp::filesystem::Pathname targetPath, zypp::ByteCount expectedFileSize=zypp::ByteCount())
 
 DownloadSpec (const DownloadSpec &other)=default
 
DownloadSpecoperator= (const DownloadSpec &other)=default
 
 DownloadSpec (DownloadSpec &&) noexcept=default
 
DownloadSpecoperator= (DownloadSpec &&) noexcept=default
 
const Urlurl () const
 
DownloadSpecsetUrl (const Url &url)
 
const zypp::PathnametargetPath () const
 
DownloadSpecsetTargetPath (const zypp::Pathname &path)
 
DownloadSpecsetMetalinkEnabled (bool enable=true)
 
bool metalinkEnabled () const
 
DownloadSpecsetCheckExistsOnly (bool set=true)
 
bool checkExistsOnly () const
 
DownloadSpecsetDeltaFile (const zypp::Pathname &file)
 
zypp::filesystem::Pathname deltaFile () const
 
DownloadSpecsetPreferredChunkSize (const zypp::ByteCount &bc)
 
zypp::ByteCount preferredChunkSize () const
 
const TransferSettingssettings () const
 
DownloadSpecsetTransferSettings (TransferSettings &&set)
 
DownloadSpecsetTransferSettings (const TransferSettings &set)
 
DownloadSpecsetExpectedFileSize (const zypp::ByteCount &bc)
 
zypp::ByteCount expectedFileSize () const
 
DownloadSpecsetHeaderSize (const zypp::ByteCount &bc)
 
zypp::ByteCount headerSize () const
 
const std::optional< zypp::CheckSum > & headerChecksum () const
 
DownloadSpecsetHeaderChecksum (const zypp::CheckSum &sum)
 

Private Attributes

zypp::RWCOW_pointer< DownloadSpecPrivated_ptr
 

Detailed Description

Specifies all aspects of a download. Used together with the zyppng::Download and zyppng::Downloader classes

Definition at line 37 of file downloadspec.h.

Constructor & Destructor Documentation

◆ DownloadSpec() [1/3]

zyppng::DownloadSpec::DownloadSpec ( Url  file,
zypp::filesystem::Pathname  targetPath,
zypp::ByteCount  expectedFileSize = zypp::ByteCount() 
)

Definition at line 40 of file downloadspec.cc.

◆ DownloadSpec() [2/3]

zyppng::DownloadSpec::DownloadSpec ( const DownloadSpec other)
default

◆ DownloadSpec() [3/3]

zyppng::DownloadSpec::DownloadSpec ( DownloadSpec &&  )
defaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

DownloadSpec& zyppng::DownloadSpec::operator= ( const DownloadSpec other)
default

◆ operator=() [2/2]

DownloadSpec& zyppng::DownloadSpec::operator= ( DownloadSpec &&  )
defaultnoexcept

◆ url()

const Url & zyppng::DownloadSpec::url ( ) const

Returns the source URL of the download

Definition at line 48 of file downloadspec.cc.

◆ setUrl()

DownloadSpec & zyppng::DownloadSpec::setUrl ( const Url url)

Definition at line 53 of file downloadspec.cc.

◆ targetPath()

const zypp::Pathname & zyppng::DownloadSpec::targetPath ( ) const

Returns the target file path, this is where the downloaded data is stored

Definition at line 59 of file downloadspec.cc.

◆ setTargetPath()

DownloadSpec & zyppng::DownloadSpec::setTargetPath ( const zypp::Pathname path)

Definition at line 64 of file downloadspec.cc.

◆ setMetalinkEnabled()

DownloadSpec & zyppng::DownloadSpec::setMetalinkEnabled ( bool  enable = true)

Enabled or disabled metalink handling. Enabled by default.

Note
if Metalink is enabled the Download tells the server that it accepts metalink files by adding a specific header to the request.

Definition at line 70 of file downloadspec.cc.

◆ metalinkEnabled()

bool zyppng::DownloadSpec::metalinkEnabled ( ) const

Definition at line 76 of file downloadspec.cc.

◆ setCheckExistsOnly()

DownloadSpec & zyppng::DownloadSpec::setCheckExistsOnly ( bool  set = true)

Enables a special mode, in this case only the existance of the file is checked but no data is actually downloaded

Definition at line 81 of file downloadspec.cc.

◆ checkExistsOnly()

bool zyppng::DownloadSpec::checkExistsOnly ( ) const

Definition at line 87 of file downloadspec.cc.

◆ setDeltaFile()

DownloadSpec & zyppng::DownloadSpec::setDeltaFile ( const zypp::Pathname file)

Set a already existing local file to be used for partial downloading, in case of a multichunk download all chunks from the file that have the expected checksum will be reused instead of downloaded

Definition at line 92 of file downloadspec.cc.

◆ deltaFile()

zypp::Pathname zyppng::DownloadSpec::deltaFile ( ) const

Definition at line 98 of file downloadspec.cc.

◆ setPreferredChunkSize()

DownloadSpec & zyppng::DownloadSpec::setPreferredChunkSize ( const zypp::ByteCount bc)

Sets the prefered amount of bytes the downloader tries to request from a single server per metalink chunk request. If the metalink description has smaller chunks those are coalesced to match the preferred size.

Setting this to 0 tells the Downloader instance to automatically calculate the chunk size. This is also the default.

Definition at line 103 of file downloadspec.cc.

◆ preferredChunkSize()

zypp::ByteCount zyppng::DownloadSpec::preferredChunkSize ( ) const

Definition at line 109 of file downloadspec.cc.

◆ settings()

const TransferSettings & zyppng::DownloadSpec::settings ( ) const

Returns the

See also
zyppng::TransferSettings for the download. The settings are reused for possible sub downloads, however authentication data is stripped if the subdownload uses a different host to fetch the data from. If there is no auth data known
sigAuthRequired is emitted.

Definition at line 114 of file downloadspec.cc.

◆ setTransferSettings() [1/2]

DownloadSpec & zyppng::DownloadSpec::setTransferSettings ( TransferSettings &&  set)

Definition at line 119 of file downloadspec.cc.

◆ setTransferSettings() [2/2]

DownloadSpec & zyppng::DownloadSpec::setTransferSettings ( const TransferSettings set)

Definition at line 125 of file downloadspec.cc.

◆ setExpectedFileSize()

DownloadSpec & zyppng::DownloadSpec::setExpectedFileSize ( const zypp::ByteCount bc)

Definition at line 131 of file downloadspec.cc.

◆ expectedFileSize()

zypp::ByteCount zyppng::DownloadSpec::expectedFileSize ( ) const

Definition at line 137 of file downloadspec.cc.

◆ setHeaderSize()

DownloadSpec & zyppng::DownloadSpec::setHeaderSize ( const zypp::ByteCount bc)

Definition at line 142 of file downloadspec.cc.

◆ headerSize()

zypp::ByteCount zyppng::DownloadSpec::headerSize ( ) const

Definition at line 148 of file downloadspec.cc.

◆ headerChecksum()

const std::optional< zypp::CheckSum > & zyppng::DownloadSpec::headerChecksum ( ) const

Definition at line 153 of file downloadspec.cc.

◆ setHeaderChecksum()

DownloadSpec & zyppng::DownloadSpec::setHeaderChecksum ( const zypp::CheckSum sum)

Definition at line 159 of file downloadspec.cc.

Member Data Documentation

◆ d_ptr

zypp::RWCOW_pointer<DownloadSpecPrivate> zyppng::DownloadSpec::d_ptr
private

Definition at line 111 of file downloadspec.h.


The documentation for this class was generated from the following files: