libzypp 17.38.5

downloader.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#ifndef ZYPP_NG_REPO_DOWNLOADER_INCLUDED
10#define ZYPP_NG_REPO_DOWNLOADER_INCLUDED
11
12#include <zypp-core/ng/base/Base>
13#include <zypp-core/ng/pipelines/Expected>
14#include <zypp-core/Pathname.h>
15#include <zypp-core/OnMediaLocation>
16#include <zypp-core/ByteCount.h>
17#include <zypp-core/ManagedFile.h>
18#include <zypp/ng/context.h>
19#include <zypp/ng/media/provide.h>
20#include <zypp/repo/PluginRepoverification.h>
21#include <zypp/RepoStatus.h>
22#include <zypp/RepoInfo.h>
23
24#include <zypp/ng/workflows/downloadwf.h>
25
26#include <optional>
27
28 namespace zyppng::repo {
29
30 ZYPP_FWD_DECL_TYPE_WITH_REFS(DownloadContext);
31
32 class DownloadContext : public CacheProviderContext
33 {
34 public:
35
36 using PluginRepoverification = zypp_private::repo::PluginRepoverification;
37 using ContextType = typename zyppng::Context;
38 using ProvideType = typename ContextType::ProvideType;
39 using MediaHandle = typename ProvideType::MediaHandle;
40
41 DownloadContext( ContextRef zyppContext, const zypp::RepoInfo &info, const zypp::Pathname &destDir );
42
43 const zypp::RepoInfo &repoInfo () const;
44 const zypp::Pathname &deltaDir () const;
45
46 zypp::RepoInfo &repoInfo();
47 std::vector<zypp::ManagedFile> &files();
48
49 const std::optional<PluginRepoverification> &pluginRepoverification() const;
50
51 void setPluginRepoverification( std::optional<PluginRepoverification> pluginRepoverification_r )
52 { _pluginRepoverification = std::move(pluginRepoverification_r); }
53
54 void setNoPluginRepoverification()
55 { setPluginRepoverification( std::nullopt ); }
56
57 void setDeltaDir(const zypp::Pathname &newDeltaDir);
58
59 private:
60 zypp::RepoInfo _repoinfo;
61 zypp::Pathname _deltaDir;
62 std::vector<zypp::ManagedFile> _files;
63 std::optional<PluginRepoverification> _pluginRepoverification;
64 };
65}
66#endif
ByteCount.h
Pathname.h
PluginRepoverification.h
RepoInfo.h
RepoStatus.h
zypp::RepoInfo
What is known about a repository.
Definition RepoInfo.h:72
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp_private::repo::PluginRepoverification
Repository metadata verification beyond GPG.
Definition PluginRepoverification.h:53
zyppng::CacheProviderContext
Definition downloadwf.h:28
zyppng::CacheProviderContext::destDir
const zypp::Pathname & destDir() const
Definition downloadwf.cc:38
zyppng::CacheProviderContext::zyppContext
const ContextRef & zyppContext() const
Definition downloadwf.cc:31
zyppng::Context
Definition context.h:27
zyppng::repo::DownloadContext
Definition downloader.h:33
zyppng::repo::DownloadContext::ProvideType
typename ContextType::ProvideType ProvideType
Definition downloader.h:38
zyppng::repo::DownloadContext::DownloadContext
DownloadContext(ContextRef zyppContext, const zypp::RepoInfo &info, const zypp::Pathname &destDir)
Definition downloader.cc:28
zyppng::repo::DownloadContext::ContextType
typename zyppng::Context ContextType
Definition downloader.h:37
zyppng::repo::DownloadContext::setPluginRepoverification
void setPluginRepoverification(std::optional< PluginRepoverification > pluginRepoverification_r)
Definition downloader.h:51
zyppng::repo::DownloadContext::PluginRepoverification
zypp_private::repo::PluginRepoverification PluginRepoverification
Definition downloader.h:36
zyppng::repo::DownloadContext::MediaHandle
typename ProvideType::MediaHandle MediaHandle
Definition downloader.h:39
zyppng::repo::DownloadContext::_deltaDir
zypp::Pathname _deltaDir
Definition downloader.h:61
zyppng::repo::DownloadContext::setNoPluginRepoverification
void setNoPluginRepoverification()
Definition downloader.h:54
zyppng::repo::DownloadContext::_files
std::vector< zypp::ManagedFile > _files
Files downloaded.
Definition downloader.h:62
zyppng::repo::DownloadContext::_repoinfo
zypp::RepoInfo _repoinfo
Definition downloader.h:60
zyppng::repo::DownloadContext::deltaDir
const zypp::Pathname & deltaDir() const
Definition downloader.cc:35
zyppng::repo::DownloadContext::pluginRepoverification
const std::optional< PluginRepoverification > & pluginRepoverification() const
Definition downloader.cc:41
zyppng::repo::DownloadContext::setDeltaDir
void setDeltaDir(const zypp::Pathname &newDeltaDir)
Definition downloader.cc:44
zyppng::repo::DownloadContext::repoInfo
const zypp::RepoInfo & repoInfo() const
Definition downloader.cc:33
zyppng::repo::DownloadContext::files
std::vector< zypp::ManagedFile > & files()
Definition downloader.cc:39
zyppng::repo::DownloadContext::_pluginRepoverification
std::optional< PluginRepoverification > _pluginRepoverification
Definition downloader.h:63
context.h
downloadwf.h
zyppng::repo
Definition downloader.cc:22
provide.h
ManagedFile.h
ZYPP_FWD_DECL_TYPE_WITH_REFS
#define ZYPP_FWD_DECL_TYPE_WITH_REFS(T)
Definition zyppglobal.h:126