libzypp: zypp/repo/yum/RepomdFileCollector.h Source File

libzypp 17.38.6

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
21namespace zypp::repo::yum
22{
23
24 struct RepomdFileCollector
25 {
26 NON_COPYABLE( RepomdFileCollector );
27 NON_MOVABLE( RepomdFileCollector );
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
50 LocaleSet _wantedLocales;
51 std::map<std::string,OnMediaLocation> _wantedFiles;
52 };
53}
54#endif
Easy.h
Locale.h
Pathname.h
zypp::Locale
'Language[_Country]' codes.
Definition Locale.h:51
zypp::OnMediaLocation
Describes a resource file located on a medium.
Definition onmedialocation.h:37
zypp::RepoInfo
What is known about a repository.
Definition RepoInfo.h:72
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::repo::yum
Definition RepomdFileCollector.cc:38
zypp::LocaleSet
std::unordered_set< Locale > LocaleSet
Definition Locale.h:29
zypp::repo::yum::RepomdFileCollector::_destDir
const Pathname & _destDir
Definition RepomdFileCollector.h:48
zypp::repo::yum::RepomdFileCollector::addWantedLocale
void addWantedLocale(Locale locale_r)
Definition RepomdFileCollector.cc:156
zypp::repo::yum::RepomdFileCollector::~RepomdFileCollector
virtual ~RepomdFileCollector()
Definition RepomdFileCollector.cc:100
zypp::repo::yum::RepomdFileCollector::_wantedFiles
std::map< std::string, OnMediaLocation > _wantedFiles
Definition RepomdFileCollector.h:51
zypp::repo::yum::RepomdFileCollector::deltaDir
virtual const Pathname & deltaDir() const =0
zypp::repo::yum::RepomdFileCollector::NON_COPYABLE
NON_COPYABLE(RepomdFileCollector)
zypp::repo::yum::RepomdFileCollector::collect
bool collect(const OnMediaLocation &loc_r, const std::string &typestr_r)
The callback invoked by the RepomdFileReader.
Definition RepomdFileCollector.cc:107
zypp::repo::yum::RepomdFileCollector::FinalizeCb
std::function< void(const OnMediaLocation &file)> FinalizeCb
Definition RepomdFileCollector.h:29
zypp::repo::yum::RepomdFileCollector::NON_MOVABLE
NON_MOVABLE(RepomdFileCollector)
zypp::repo::yum::RepomdFileCollector::finalize
void finalize(const FinalizeCb &cb)
Definition RepomdFileCollector.cc:143
zypp::repo::yum::RepomdFileCollector::repoInfo
virtual const RepoInfo & repoInfo() const =0
zypp::repo::yum::RepomdFileCollector::wantLocale
bool wantLocale(const Locale &locale_r) const
Definition RepomdFileCollector.cc:153
zypp::repo::yum::RepomdFileCollector::RepomdFileCollector
RepomdFileCollector(const Pathname &destDir_r)
Definition RepomdFileCollector.cc:92
zypp::repo::yum::RepomdFileCollector::_wantedLocales
LocaleSet _wantedLocales
Locales do download.
Definition RepomdFileCollector.h:50