libzypp: zypp/ng/repo/downloader.h Source File

libzypp 17.36.6

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/zyppng/base/Base>
13#include <zypp-core/zyppng/pipelines/AsyncResult>
14#include <zypp-core/zyppng/pipelines/Expected>
15#include <zypp-core/Pathname.h>
16#include <zypp-core/OnMediaLocation>
17#include <zypp-core/ByteCount.h>
18#include <zypp-core/ManagedFile.h>
19#include <zypp-media/ng/ProvideRes>
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
28namespace zyppng {
29 ZYPP_FWD_DECL_TYPE_WITH_REFS( Context );
30 ZYPP_FWD_DECL_TYPE_WITH_REFS( SyncContext );
31}
32
33namespace zyppng::repo {
34 template <class ContextRefType>
35 class DownloadContext : public CacheProviderContext<ContextRefType>
36 {
37 public:
38
39 using PluginRepoverification = zypp_private::repo::PluginRepoverification;
40 using ContextType = typename ContextRefType::element_type;
41 using ProvideType = typename ContextType::ProvideType;
42 using MediaHandle = typename ProvideType::MediaHandle;
43
44 DownloadContext( ContextRefType zyppContext, const zypp::RepoInfo &info, const zypp::Pathname &destDir );
45
46 const zypp::RepoInfo &repoInfo () const;
47 const zypp::Pathname &deltaDir () const;
48
49 zypp::RepoInfo &repoInfo();
50 std::vector<zypp::ManagedFile> &files();
51
52 const std::optional<PluginRepoverification> &pluginRepoverification() const;
53
54 void setPluginRepoverification( std::optional<PluginRepoverification> pluginRepoverification_r )
55 { _pluginRepoverification = std::move(pluginRepoverification_r); }
56
57 void setNoPluginRepoverification()
58 { setPluginRepoverification( std::nullopt ); }
59
60 void setDeltaDir(const zypp::Pathname &newDeltaDir);
61
62 private:
63 zypp::RepoInfo _repoinfo;
64 zypp::Pathname _deltaDir;
65 std::vector<zypp::ManagedFile> _files;
66 std::optional<PluginRepoverification> _pluginRepoverification;
67 };
68
69 using SyncDownloadContext = DownloadContext<SyncContextRef>;
70 using AsyncDownloadContext = DownloadContext<ContextRef>;
71 ZYPP_FWD_DECL_REFS(SyncDownloadContext);
72 ZYPP_FWD_DECL_REFS(AsyncDownloadContext);
73}
74#endif
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:47
zypp_private::repo::PluginRepoverification
Repository metadata verification beyond GPG.
Definition PluginRepoverification.h:53
zyppng::CacheProviderContext
Definition downloadwf.h:28
zyppng::CacheProviderContext< SyncContextRef >::destDir
const zypp::Pathname & destDir() const
zyppng::CacheProviderContext< SyncContextRef >::zyppContext
const ContextRefType & zyppContext() const
zyppng::CacheProviderContext< SyncContextRef >::ContextRefType
SyncContextRef ContextRefType
Definition downloadwf.h:32
zyppng::Context
Definition context.h:39
zyppng::SyncContext
Definition contextfacade.h:27
zyppng::repo::DownloadContext
Definition downloader.h:36
zyppng::repo::DownloadContext< SyncContextRef >::_pluginRepoverification
std::optional< PluginRepoverification > _pluginRepoverification
Definition downloader.h:66
zyppng::repo::DownloadContext::repoInfo
const zypp::RepoInfo & repoInfo() const
Definition downloader.cc:37
zyppng::repo::DownloadContext::ProvideType
typename ContextType::ProvideType ProvideType
Definition downloader.h:41
zyppng::repo::DownloadContext::pluginRepoverification
const std::optional< PluginRepoverification > & pluginRepoverification() const
Definition downloader.cc:49
zyppng::repo::DownloadContext::setNoPluginRepoverification
void setNoPluginRepoverification()
Definition downloader.h:57
zyppng::repo::DownloadContext::setPluginRepoverification
void setPluginRepoverification(std::optional< PluginRepoverification > pluginRepoverification_r)
Definition downloader.h:54
zyppng::repo::DownloadContext::setDeltaDir
void setDeltaDir(const zypp::Pathname &newDeltaDir)
Definition downloader.cc:53
zyppng::repo::DownloadContext::files
std::vector< zypp::ManagedFile > & files()
Definition downloader.cc:46
zyppng::repo::DownloadContext< SyncContextRef >::_repoinfo
zypp::RepoInfo _repoinfo
Definition downloader.h:63
zyppng::repo::DownloadContext::repoInfo
zypp::RepoInfo & repoInfo()
Definition downloader.cc:43
zyppng::repo::DownloadContext::ContextType
typename ContextRefType::element_type ContextType
Definition downloader.h:40
zyppng::repo::DownloadContext::deltaDir
const zypp::Pathname & deltaDir() const
Definition downloader.cc:40
zyppng::repo::DownloadContext::MediaHandle
typename ProvideType::MediaHandle MediaHandle
Definition downloader.h:42
zyppng::repo::DownloadContext< SyncContextRef >::_deltaDir
zypp::Pathname _deltaDir
Definition downloader.h:64
zyppng::repo::DownloadContext::DownloadContext
DownloadContext(ContextRefType zyppContext, const zypp::RepoInfo &info, const zypp::Pathname &destDir)
Definition downloader.cc:31
zyppng::repo::DownloadContext::PluginRepoverification
zypp_private::repo::PluginRepoverification PluginRepoverification
Definition downloader.h:39
zyppng::repo::DownloadContext< SyncContextRef >::_files
std::vector< zypp::ManagedFile > _files
Definition downloader.h:65
downloadwf.h
zyppng::repo
Definition downloader.cc:25
zyppng::repo::SyncDownloadContext
DownloadContext< SyncContextRef > SyncDownloadContext
Definition downloader.h:69
zyppng::repo::AsyncDownloadContext
DownloadContext< ContextRef > AsyncDownloadContext
Definition downloader.h:70
zyppng
Definition MediaCurl2.h:22
ByteCount.h
ManagedFile.h
Pathname.h
ZYPP_FWD_DECL_REFS
#define ZYPP_FWD_DECL_REFS(T)
Definition zyppglobal.h:119
ZYPP_FWD_DECL_TYPE_WITH_REFS
#define ZYPP_FWD_DECL_TYPE_WITH_REFS(T)
Definition zyppglobal.h:126