1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
10 #ifndef ZYPP_PROVIDEFILEPOLICY_H
11 #define ZYPP_PROVIDEFILEPOLICY_H
15 #include "zypp/base/Function.h"
16 #include "zypp/base/Functional.h"
18 ///////////////////////////////////////////////////////////////////
20 { /////////////////////////////////////////////////////////////////
21 ///////////////////////////////////////////////////////////////////
22 // CLASS NAME : ProvideFilePolicy
24 /** Policy for \ref provideFile.
25 * Provides callback hook for progress reporting.
27 class ProvideFilePolicy
30 /** Progress callback signature. */
31 typedef function<bool ( int )> ProgressCB;
34 ProvideFilePolicy & progressCB( ProgressCB progressCB_r )
35 { _progressCB = progressCB_r; return *this; }
37 /** Evaluate callback. */
38 bool progress( int value ) const;
41 typedef function<bool ()> FailOnChecksumErrorCB; ///< Legacy to remain bincompat
43 FailOnChecksumErrorCB _failOnChecksumErrorCB; ///< Legacy to remain bincompat
44 ProgressCB _progressCB;
48 ///////////////////////////////////////////////////////////////////
49 #endif // ZYPP_PROVIDEFILEPOLICY_H