libzypp  17.38.7
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>
21 #include <zypp/RepoStatus.h>
22 #include <zypp/RepoInfo.h>
23 
25 
26 #include <optional>
27 
28 namespace zyppng::repo {
29 
30  ZYPP_FWD_DECL_TYPE_WITH_REFS(DownloadContext);
31 
33  {
34  public:
35 
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 
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 
55  { setPluginRepoverification( std::nullopt ); }
56 
57  void setDeltaDir(const zypp::Pathname &newDeltaDir);
58 
59  private:
62  std::vector<zypp::ManagedFile> _files;
63  std::optional<PluginRepoverification> _pluginRepoverification;
64  };
65 }
66 #endif
void setDeltaDir(const zypp::Pathname &newDeltaDir)
Definition: downloader.cc:44
std::vector< zypp::ManagedFile > & files()
Definition: downloader.cc:39
Repository metadata verification beyond GPG.
DownloadContext(ContextRef zyppContext, const zypp::RepoInfo &info, const zypp::Pathname &destDir)
Definition: downloader.cc:28
What is known about a repository.
Definition: RepoInfo.h:71
const zypp::RepoInfo & repoInfo() const
Definition: downloader.cc:33
typename ContextType::ProvideType ProvideType
Definition: downloader.h:38
typename ProvideType::MediaHandle MediaHandle
Definition: downloader.h:39
const std::optional< PluginRepoverification > & pluginRepoverification() const
Definition: downloader.cc:41
const zypp::Pathname & deltaDir() const
Definition: downloader.cc:35
void setPluginRepoverification(std::optional< PluginRepoverification > pluginRepoverification_r)
Definition: downloader.h:51
std::vector< zypp::ManagedFile > _files
Files downloaded.
Definition: downloader.h:62
typename zyppng::Context ContextType
Definition: downloader.h:37
zypp_private::repo::PluginRepoverification PluginRepoverification
Definition: repomanager.h:43
ZYPP_FWD_DECL_TYPE_WITH_REFS(DownloadContext)
const zypp::Pathname & destDir() const
Definition: downloadwf.cc:38
std::optional< PluginRepoverification > _pluginRepoverification
Definition: downloader.h:63
const ContextRef & zyppContext() const
Definition: downloadwf.cc:31