libzypp: zyppng::ProvideFileSpec Class Reference

libzypp 17.38.10

zyppng::ProvideFileSpec Class Reference

`#include <zypp-media/ng/providespec.h>`

## Classes
class | Impl

## Public Member Functions
| ProvideFileSpec ()
| ProvideFileSpec (const zypp::OnMediaLocation &loc)
| ProvideFileSpec (const ProvideFileSpec &)=default
| ProvideFileSpec (ProvideFileSpec &&) noexcept=default
ProvideFileSpec & | operator= (const ProvideFileSpec &)=default
ProvideFileSpec & | operator= (ProvideFileSpec &&) noexcept=default
| ~ProvideFileSpec ()
| Dtor.
const zypp::Pathname & | destFilenameHint () const
ProvideFileSpec & | setDestFilenameHint (const zypp::Pathname &filename)
bool | checkExistsOnly () const
ProvideFileSpec & | setCheckExistsOnly (const bool set=true)
bool | optional () const
| Whether this is an optional resource.
ProvideFileSpec & | setOptional (bool val)
| Set whether the resource is optional.
const zypp::ByteCount & | downloadSize () const
| The size of the resource on the server.
ProvideFileSpec & | setDownloadSize (const zypp::ByteCount &val_r)
| Set the downloadSize.
const zypp::CheckSum & | checksum () const
| The checksum of the resource on the server.
ProvideFileSpec & | setChecksum (const zypp::CheckSum &val_r)
| Set the checksum.
const zypp::ByteCount & | openSize () const
| The size of the resource once it has been uncompressed or unpacked.
ProvideFileSpec & | setOpenSize (const zypp::ByteCount &val_r)
| Set the openSize.
const zypp::CheckSum & | openChecksum () const
| The checksum of the resource once it has been uncompressed or unpacked.
ProvideFileSpec & | setOpenChecksum (const zypp::CheckSum &val_r)
| Set the openChecksum.
const zypp::ByteCount & | headerSize () const
| The size of the header prepending the resource (e.g.
ProvideFileSpec & | setHeaderSize (const zypp::ByteCount &val_r)
| Set the headerSize.
const zypp::CheckSum & | headerChecksum () const
| The checksum of the header prepending the resource (e.g.
ProvideFileSpec & | setHeaderChecksum (const zypp::CheckSum &val_r)
| Set the headerChecksum.
const zypp::Pathname & | deltafile () const
| The existing deltafile that can be used to reduce download size ( zchunk or metalink ).
ProvideFileSpec & | setDeltafile (const zypp::Pathname &path)
| Set the deltafile.
bool | mirrorsAllowed () const
| The requested file is allowed to be fetched via mirrors ( defaults to true ).
ProvideFileSpec & | setMirrorsAllowed (bool set=true)
| Enables or disables the use of mirrors when fetching this file.
HeaderValueMap & | customHeaders ()
const HeaderValueMap & | customHeaders () const
ProvideFileSpec & | setCustomHeaderValue (const std::string &key, const HeaderValueMap::Value &val)
ProvideFileSpec & | addCustomHeaderValue (const std::string &key, const HeaderValueMap::Value &val)
zypp::OnMediaLocation | asOnMediaLocation (const zypp::Pathname &path, unsigned int mediaNr) const

## Static Public Member Functions
template<typename... T>
static ProvideFileSpecRef | create (T... args)

## Private Attributes
zypp::RWCOW_pointer< Impl > | _pimpl
| Implementation class.

## Friends
std::ostream & | operator<< (std::ostream &str, const ProvideFileSpec &obj)
| relates: ProvideSpec Stream output
std::ostream & | dumpOn (std::ostream &str, const ProvideFileSpec &obj)
| relates: ProvideSpec Verbose stream output

## Detailed Description

Definition at line 94 of file providespec.h.

## Constructor & Destructor Documentation

## ◆ ProvideFileSpec() [1/4]

zyppng::ProvideFileSpec::ProvideFileSpec | ( |  | ) |

Definition at line 192 of file providespec.cc.

## ◆ ProvideFileSpec() [2/4]

zyppng::ProvideFileSpec::ProvideFileSpec | ( | const zypp::OnMediaLocation & | loc | ) |

Definition at line 196 of file providespec.cc.

## ◆ ProvideFileSpec() [3/4]

zyppng::ProvideFileSpec::ProvideFileSpec | ( | const ProvideFileSpec & |  | ) |
| default

## ◆ ProvideFileSpec() [4/4]

zyppng::ProvideFileSpec::ProvideFileSpec | ( | ProvideFileSpec && |  | ) |
| defaultnoexcept

## ◆ ~ProvideFileSpec()

zyppng::ProvideFileSpec::~ProvideFileSpec | ( |  | ) |

Dtor.

Definition at line 209 of file providespec.cc.

## Member Function Documentation

## ◆ operator=() [1/2]

ProvideFileSpec & zyppng::ProvideFileSpec::operator= | ( | const ProvideFileSpec & |  | ) |
| default

## ◆ operator=() [2/2]

ProvideFileSpec & zyppng::ProvideFileSpec::operator= | ( | ProvideFileSpec && |  | ) |
| defaultnoexcept

## ◆ create()

template<typename... T>

ProvideFileSpecRef zyppng::ProvideFileSpec::create | ( | T... | args | ) |
| inlinestatic

Definition at line 114 of file providespec.h.

## ◆ destFilenameHint()

const zypp::filesystem::Pathname & zyppng::ProvideFileSpec::destFilenameHint | ( |  | ) | const

The destination file name, this is optional and is only a hint to the Provide instance where to put the file IF possible. The file provider does not need to consider this.

Definition at line 212 of file providespec.cc.

## ◆ setDestFilenameHint()

ProvideFileSpec & zyppng::ProvideFileSpec::setDestFilenameHint | ( | const zypp::Pathname & | filename | ) |

Definition at line 215 of file providespec.cc.

## ◆ checkExistsOnly()

bool zyppng::ProvideFileSpec::checkExistsOnly | ( |  | ) | const

Definition at line 218 of file providespec.cc.

## ◆ setCheckExistsOnly()

ProvideFileSpec & zyppng::ProvideFileSpec::setCheckExistsOnly | ( | const bool | set = true | ) |

Definition at line 221 of file providespec.cc.

## ◆ optional()

bool zyppng::ProvideFileSpec::optional | ( |  | ) | const

Whether this is an optional resource.

This is a hint to the downloader not to report an error if the resource is not present on the server.

Definition at line 224 of file providespec.cc.

## ◆ setOptional()

ProvideFileSpec & zyppng::ProvideFileSpec::setOptional | ( | bool | val | ) |

Set whether the resource is optional.

Definition at line 227 of file providespec.cc.

## ◆ downloadSize()

const zypp::ByteCount & zyppng::ProvideFileSpec::downloadSize | ( |  | ) | const

The size of the resource on the server.

Definition at line 230 of file providespec.cc.

## ◆ setDownloadSize()

ProvideFileSpec & zyppng::ProvideFileSpec::setDownloadSize | ( | const zypp::ByteCount & | val_r | ) |

Set the downloadSize.

Definition at line 233 of file providespec.cc.

## ◆ checksum()

const zypp::CheckSum & zyppng::ProvideFileSpec::checksum | ( |  | ) | const

The checksum of the resource on the server.

Definition at line 236 of file providespec.cc.

## ◆ setChecksum()

ProvideFileSpec & zyppng::ProvideFileSpec::setChecksum | ( | const zypp::CheckSum & | val_r | ) |

Set the checksum.

Definition at line 239 of file providespec.cc.

## ◆ openSize()

const zypp::ByteCount & zyppng::ProvideFileSpec::openSize | ( |  | ) | const

The size of the resource once it has been uncompressed or unpacked.

Definition at line 242 of file providespec.cc.

## ◆ setOpenSize()

ProvideFileSpec & zyppng::ProvideFileSpec::setOpenSize | ( | const zypp::ByteCount & | val_r | ) |

Set the openSize.

Definition at line 245 of file providespec.cc.

## ◆ openChecksum()

const zypp::CheckSum & zyppng::ProvideFileSpec::openChecksum | ( |  | ) | const

The checksum of the resource once it has been uncompressed or unpacked.

Definition at line 248 of file providespec.cc.

## ◆ setOpenChecksum()

ProvideFileSpec & zyppng::ProvideFileSpec::setOpenChecksum | ( | const zypp::CheckSum & | val_r | ) |

Set the openChecksum.

Definition at line 251 of file providespec.cc.

## ◆ headerSize()

const zypp::ByteCount & zyppng::ProvideFileSpec::headerSize | ( |  | ) | const

The size of the header prepending the resource (e.g.

for zchunk).

Definition at line 254 of file providespec.cc.

## ◆ setHeaderSize()

ProvideFileSpec & zyppng::ProvideFileSpec::setHeaderSize | ( | const zypp::ByteCount & | val_r | ) |

Set the headerSize.

Definition at line 257 of file providespec.cc.

## ◆ headerChecksum()

const zypp::CheckSum & zyppng::ProvideFileSpec::headerChecksum | ( |  | ) | const

The checksum of the header prepending the resource (e.g.

for zchunk).

Definition at line 260 of file providespec.cc.

## ◆ setHeaderChecksum()

ProvideFileSpec & zyppng::ProvideFileSpec::setHeaderChecksum | ( | const zypp::CheckSum & | val_r | ) |

Set the headerChecksum.

Definition at line 263 of file providespec.cc.

## ◆ deltafile()

const zypp::Pathname & zyppng::ProvideFileSpec::deltafile | ( |  | ) | const

The existing deltafile that can be used to reduce download size ( zchunk or metalink ).

Definition at line 266 of file providespec.cc.

## ◆ setDeltafile()

ProvideFileSpec & zyppng::ProvideFileSpec::setDeltafile | ( | const zypp::Pathname & | path | ) |

Set the deltafile.

Definition at line 269 of file providespec.cc.

## ◆ mirrorsAllowed()

bool zyppng::ProvideFileSpec::mirrorsAllowed | ( |  | ) | const

The requested file is allowed to be fetched via mirrors ( defaults to true ).

Definition at line 272 of file providespec.cc.

## ◆ setMirrorsAllowed()

ProvideFileSpec & zyppng::ProvideFileSpec::setMirrorsAllowed | ( | bool | set = true | ) |

Enables or disables the use of mirrors when fetching this file.

Definition at line 275 of file providespec.cc.

## ◆ customHeaders() [1/2]

HeaderValueMap & zyppng::ProvideFileSpec::customHeaders | ( |  | ) |

Returns a map of custom key->value pairs that can control special aspects of how the provide operation is processed.

Todo
  should this actually just be a list of pair(string,string) instead of map? -> easier way to send multiple values to a worker

Definition at line 278 of file providespec.cc.

## ◆ customHeaders() [2/2]

const HeaderValueMap & zyppng::ProvideFileSpec::customHeaders | ( |  | ) | const

Definition at line 281 of file providespec.cc.

## ◆ setCustomHeaderValue()

ProvideFileSpec & zyppng::ProvideFileSpec::setCustomHeaderValue | ( | const std::string & | key,
|  | const HeaderValueMap::Value & | val )

Set the custom header value identified by key to val

Definition at line 284 of file providespec.cc.

## ◆ addCustomHeaderValue()

ProvideFileSpec & zyppng::ProvideFileSpec::addCustomHeaderValue | ( | const std::string & | key,
|  | const HeaderValueMap::Value & | val )

Adds the custom header value val to the list of values identified by key

Definition at line 290 of file providespec.cc.

## ◆ asOnMediaLocation()

zypp::OnMediaLocation zyppng::ProvideFileSpec::asOnMediaLocation | ( | const zypp::Pathname & | path,
|  | unsigned int | mediaNr ) const

Definition at line 296 of file providespec.cc.

## Friends And Related Symbol Documentation

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | str,
|  | const ProvideFileSpec & | obj )
| friend

relates: ProvideSpec Stream output

Definition at line 310 of file providespec.cc.

## ◆ dumpOn

std::ostream & dumpOn | ( | std::ostream & | str,
|  | const ProvideFileSpec & | obj )
| friend

relates: ProvideSpec Verbose stream output

Definition at line 313 of file providespec.cc.

## Member Data Documentation

## ◆ _pimpl

zypp::RWCOW_pointer<Impl> zyppng::ProvideFileSpec::_pimpl
| private

Implementation class.

Pointer to implementation.

Definition at line 204 of file providespec.h.

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

- zypp-media/ng/providespec.h
- zypp-media/ng/providespec.cc