libzypp
10.5.0
|
00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00009 00010 #ifndef ZYPP_PROVIDEFILEPOLICY_H 00011 #define ZYPP_PROVIDEFILEPOLICY_H 00012 00013 #include <iosfwd> 00014 00015 #include "zypp/base/Function.h" 00016 #include "zypp/base/Functional.h" 00017 00019 namespace zypp 00020 { 00021 00022 // CLASS NAME : ProvideFilePolicy 00023 00029 class ProvideFilePolicy 00030 { 00031 public: 00033 typedef function<bool ( int )> ProgressCB; 00034 00036 ProvideFilePolicy & progressCB( ProgressCB progressCB_r ) 00037 { _progressCB = progressCB_r; return *this; } 00038 00040 bool progress( int value ) const; 00041 00042 public: 00044 typedef function<bool ()> FailOnChecksumErrorCB; 00045 00047 ProvideFilePolicy & failOnChecksumErrorCB( FailOnChecksumErrorCB failOnChecksumErrorCB_r ) 00048 { _failOnChecksumErrorCB = failOnChecksumErrorCB_r; return *this; } 00049 00053 ProvideFilePolicy & failOnChecksumErrorCB( bool yesno_r ); 00054 00056 bool failOnChecksumError() const; 00057 00058 private: 00059 FailOnChecksumErrorCB _failOnChecksumErrorCB; 00060 ProgressCB _progressCB; 00061 }; 00062 00063 } // namespace zypp 00065 #endif // ZYPP_PROVIDEFILEPOLICY_H