libzypp  17.35.16
RepomdFileCollector.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 
10 #ifndef ZYPP_SOURCE_YUM_REPOMDFILECOLLECTOR
11 #define ZYPP_SOURCE_YUM_REPOMDFILECOLLECTOR
12 
13 #include <zypp-core/base/Easy.h>
14 #include <zypp-core/OnMediaLocation>
15 #include <zypp-core/Pathname.h>
16 #include <zypp/Locale.h>
17 #include <map>
18 #include <string>
19 #include <functional>
20 
21 namespace zypp::repo::yum
22 {
23 
25  {
28 
29  using FinalizeCb = std::function<void ( const OnMediaLocation &file )>;
30 
31  RepomdFileCollector( const Pathname & destDir_r );
32  virtual ~RepomdFileCollector();
33 
34  bool collect( const OnMediaLocation & loc_r, const std::string & typestr_r );
35 
36  void finalize( const FinalizeCb &cb );
37 
38  protected:
39  virtual const RepoInfo &repoInfo() const = 0;
40  virtual const Pathname &deltaDir() const = 0;
41 
42  private:
43 
44  bool wantLocale( const Locale & locale_r ) const;
45  void addWantedLocale( Locale locale_r );
46 
47  protected:
48  const Pathname & _destDir;
49 
51  std::map<std::string,OnMediaLocation> _wantedFiles;
52  };
53 }
54 #endif
std::function< void(const OnMediaLocation &file)> FinalizeCb
Describes a resource file located on a medium.
virtual const Pathname & deltaDir() const =0
Helper filtering the files offered by a RepomdFileReader.
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:29
bool collect(const OnMediaLocation &loc_r, const std::string &typestr_r)
The callback invoked by the RepomdFileReader.
What is known about a repository.
Definition: RepoInfo.h:71
LocaleSet _wantedLocales
Locales do download.
virtual const RepoInfo & repoInfo() const =0
RepomdFileCollector(const Pathname &destDir_r)
&#39;Language[_Country]&#39; codes.
Definition: Locale.h:50
bool wantLocale(const Locale &locale_r) const
std::map< std::string, OnMediaLocation > _wantedFiles