libzypp  17.36.3
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>
21 #include <zypp/RepoStatus.h>
22 #include <zypp/RepoInfo.h>
23 
25 
26 #include <optional>
27 
28 namespace zyppng {
30  ZYPP_FWD_DECL_TYPE_WITH_REFS( SyncContext );
31 }
32 
33 namespace zyppng::repo {
34  template <class ContextRefType>
35  class DownloadContext : public CacheProviderContext<ContextRefType>
36  {
37  public:
38 
40  using ContextType = typename ContextRefType::element_type;
41  using ProvideType = typename ContextType::ProvideType;
42  using MediaHandle = typename ProvideType::MediaHandle;
43 
45 
46  const zypp::RepoInfo &repoInfo () const;
47  const zypp::Pathname &deltaDir () const;
48 
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 
58  { setPluginRepoverification( std::nullopt ); }
59 
60  void setDeltaDir(const zypp::Pathname &newDeltaDir);
61 
62  private:
65  std::vector<zypp::ManagedFile> _files;
66  std::optional<PluginRepoverification> _pluginRepoverification;
67  };
68 
73 }
74 #endif
void setDeltaDir(const zypp::Pathname &newDeltaDir)
Definition: downloader.cc:53
typename ContextRefType::element_type ContextType
Definition: downloader.h:40
Repository metadata verification beyond GPG.
const std::optional< PluginRepoverification > & pluginRepoverification() const
Definition: downloader.cc:49
const zypp::RepoInfo & repoInfo() const
Definition: downloader.cc:37
What is known about a repository.
Definition: RepoInfo.h:71
const zypp::Pathname & destDir() const
Definition: downloadwf.cc:42
void setPluginRepoverification(std::optional< PluginRepoverification > pluginRepoverification_r)
Definition: downloader.h:54
std::vector< zypp::ManagedFile > & files()
Definition: downloader.cc:46
const ContextRefType & zyppContext() const
Definition: downloadwf.cc:35
ZYPP_FWD_DECL_REFS(SyncDownloadContext)
typename ContextType::ProvideType ProvideType
Definition: downloader.h:41
const zypp::Pathname & deltaDir() const
Definition: downloader.cc:40
zypp_private::repo::PluginRepoverification PluginRepoverification
Definition: repomanager.h:41
std::vector< zypp::ManagedFile > _files
Files downloaded.
Definition: downloader.h:65
ZYPP_FWD_DECL_TYPE_WITH_REFS(EventDispatcher)
std::optional< PluginRepoverification > _pluginRepoverification
Definition: downloader.h:66
typename ProvideType::MediaHandle MediaHandle
Definition: downloader.h:42
DownloadContext(ContextRefType zyppContext, const zypp::RepoInfo &info, const zypp::Pathname &destDir)
Definition: downloader.cc:31