libzypp 17.37.10

zyppng::ProvideRes Class Reference

A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide instance. More...

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

## Public Member Functions
| ProvideRes (std::shared_ptr< ProvideResourceData > dataPtr)
virtual | ~ProvideRes ()
const zypp::Pathname | file () const
const zypp::ManagedFile & | asManagedFile () const
const ProvideMediaHandle & | mediaHandle () const
const zypp::Url & | resourceUrl () const
const HeaderValueMap & | headers () const

## Private Attributes
std::shared_ptr< ProvideResourceData > | _data

## Detailed Description

A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide instance.

It is generally advisable to release a ProvideRes instance asap, to make sure resources can be released and devices are free to be ejected.

Note
  all ProvideRes instances will become invalid when the Provide instance is released.

Definition at line 35 of file provideres.h.

## Constructor & Destructor Documentation

## ◆ ProvideRes()

zyppng::ProvideRes::ProvideRes | ( | std::shared_ptr< ProvideResourceData > | dataPtr | ) |

Definition at line 15 of file provideres.cc.

## ◆ ~ProvideRes()

zyppng::ProvideRes::~ProvideRes | ( |  | ) |
| virtual

Definition at line 18 of file provideres.cc.

## Member Function Documentation

## ◆ file()

const zypp::filesystem::Pathname zyppng::ProvideRes::file | ( |  | ) | const

Returns the path to the provided file

Definition at line 21 of file provideres.cc.

## ◆ asManagedFile()

const zypp::ManagedFile & zyppng::ProvideRes::asManagedFile | ( |  | ) | const

Returns a reference to the internally used managed file instance.

Note
  If you obtain this for a file that is inside the providers working directory ( e.g. a provide result for a download ), the continued use after the Provide instance was relased is undefined behaviour and not supported!

Definition at line 26 of file provideres.cc.

## ◆ mediaHandle()

const ProvideMediaHandle & zyppng::ProvideRes::mediaHandle | ( |  | ) | const

Returns a reference to the currently held media handle, this can be a invalid handle

Definition at line 31 of file provideres.cc.

## ◆ resourceUrl()

const zypp::Url & zyppng::ProvideRes::resourceUrl | ( |  | ) | const

The URL this ressource was provided from, can be empty

Definition at line 36 of file provideres.cc.

## ◆ headers()

const HeaderValueMap & zyppng::ProvideRes::headers | ( |  | ) | const

All headers that were received from the worker when sending the result

Definition at line 41 of file provideres.cc.

## Member Data Documentation

## ◆ _data

std::shared_ptr<ProvideResourceData> zyppng::ProvideRes::_data
| private

Definition at line 69 of file provideres.h.

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

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