ProvideFilePolicy.cc

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00009 
00010 #include <iostream>
00011 #include <fstream>
00012 #include <sstream>
00013 #include "zypp/base/Logger.h"
00014 
00015 #include "zypp/ProvideFilePolicy.h"
00016 
00017 using std::endl;
00018 
00020 namespace zypp
00021 { 
00022 
00023   //
00024   //    CLASS NAME : ProvideFilePolicy
00025   //
00027 
00029   namespace
00030   { 
00031 
00032     bool yes() { return true; }
00033     bool no()  { return false; }
00034 
00036   } // namespace
00038 
00039   ProvideFilePolicy & ProvideFilePolicy::failOnChecksumErrorCB( bool yesno_r )
00040   {
00041     _failOnChecksumErrorCB = (yesno_r ? &yes : &no);
00042     return *this;
00043   }
00044 
00045   bool ProvideFilePolicy::progress( int value ) const
00046   {
00047     if ( _progressCB )
00048       return _progressCB( value );
00049     return true;
00050   }
00051 
00052   bool ProvideFilePolicy::failOnChecksumError() const
00053   {
00054     if ( _failOnChecksumErrorCB )
00055       return _failOnChecksumErrorCB();
00056     return true;
00057   }
00058 
00059 } // namespace zypp

doxygen