libzypp 17.37.10

ProvideFilePolicy.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9
10#ifndef ZYPP_PROVIDEFILEPOLICY_H
11#define ZYPP_PROVIDEFILEPOLICY_H
12
13#include <iosfwd>
14#include <utility>
15
16#include <zypp/base/Function.h>
17#include <zypp/base/Functional.h>
18#include <zypp/FileChecker.h>
19
21 namespace zypp
22{
30 class ProvideFilePolicy
31 {
32 public:
34 using ProgressCB = function<bool (int)>;
35
37 ProvideFilePolicy & progressCB( ProgressCB progressCB_r )
38 { _progressCB = std::move(progressCB_r); return *this; }
39
41 bool progress( int value ) const;
42
43 public:
45 ProvideFilePolicy & fileChecker( FileChecker fileChecker_r )
46 { _fileChecker = std::move(fileChecker_r); return *this; }
47
49 const FileChecker & fileChecker() const
50 { return _fileChecker; }
51
52 private:
53 FileChecker _fileChecker;
54 ProgressCB _progressCB;
55 };
56
57} // namespace zypp
59#endif // ZYPP_PROVIDEFILEPOLICY_H
FileChecker.h
Functional.h
bool
zypp::ProvideFilePolicy
Policy for provideFile and RepoMediaAccess.
Definition ProvideFilePolicy.h:31
zypp::ProvideFilePolicy::fileChecker
ProvideFilePolicy & fileChecker(FileChecker fileChecker_r)
Add a FileCecker passed down to the Fetcher.
Definition ProvideFilePolicy.h:45
zypp::ProvideFilePolicy::_fileChecker
FileChecker _fileChecker
Definition ProvideFilePolicy.h:53
zypp::ProvideFilePolicy::ProgressCB
function< bool(int)> ProgressCB
Progress callback signature.
Definition ProvideFilePolicy.h:34
zypp::ProvideFilePolicy::_progressCB
ProgressCB _progressCB
Definition ProvideFilePolicy.h:54
zypp::ProvideFilePolicy::progress
bool progress(int value) const
Evaluate callback.
Definition ProvideFilePolicy.cc:28
zypp::ProvideFilePolicy::progressCB
ProvideFilePolicy & progressCB(ProgressCB progressCB_r)
Set callback.
Definition ProvideFilePolicy.h:37
zypp::ProvideFilePolicy::fileChecker
const FileChecker & fileChecker() const
The FileCecker.
Definition ProvideFilePolicy.h:49
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::FileChecker
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Definition FileChecker.h:38
Function.h