libzypp  17.36.1
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 {
31  {
32  public:
34  using ProgressCB = function<bool (int)>;
35 
38  { _progressCB = std::move(progressCB_r); return *this; }
39 
41  bool progress( int value ) const;
42 
43  public:
46  { _fileChecker = std::move(fileChecker_r); return *this; }
47 
49  const FileChecker & fileChecker() const
50  { return _fileChecker; }
51 
52  private:
55  };
56 
57 } // namespace zypp
59 #endif // ZYPP_PROVIDEFILEPOLICY_H
function< bool(int)> ProgressCB
Progress callback signature.
const FileChecker & fileChecker() const
The FileCecker.
bool progress(int value) const
Evaluate callback.
Policy for provideFile and RepoMediaAccess.
ProvideFilePolicy & fileChecker(FileChecker fileChecker_r)
Add a FileCecker passed down to the Fetcher.
ProvideFilePolicy & progressCB(ProgressCB progressCB_r)
Set callback.
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Definition: FileChecker.h:29
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19