ZYppCommitPolicy.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_ZYPPCOMMITPOLICY_H
00013 #define ZYPP_ZYPPCOMMITPOLICY_H
00014 
00015 #include <iosfwd>
00016 
00018 namespace zypp
00019 { 
00020 
00022   //
00023   //    CLASS NAME : ZYppCommitPolicy
00024   //
00026   class ZYppCommitPolicy
00027   {
00028   public:
00029     ZYppCommitPolicy()
00030     : _restrictToMedia    ( 0 )
00031     , _dryRun             ( false )
00032     , _rpmNoSignature     ( false )
00033     , _syncPoolAfterCommit( true )
00034     {}
00035 
00036   public:
00037     unsigned restrictToMedia() const
00038     { return _restrictToMedia; }
00039 
00040     bool dryRun() const
00041     { return _dryRun; }
00042 
00043     bool rpmNoSignature() const
00044     { return _rpmNoSignature; }
00045 
00046     bool syncPoolAfterCommit() const
00047     { return _syncPoolAfterCommit; }
00048 
00049   public:
00055     ZYppCommitPolicy & restrictToMedia( unsigned mediaNr_r )
00056     { _restrictToMedia = ( mediaNr_r == 1 ) ? 1 : 0; return *this; }
00057 
00059     ZYppCommitPolicy & allMedia()
00060     { return restrictToMedia( 0 ); }
00061 
00063     ZYppCommitPolicy & dryRun( bool yesNo_r = true )
00064     { _dryRun = yesNo_r; return *this; }
00065 
00067     ZYppCommitPolicy & rpmNoSignature( bool yesNo_r = true )
00068     { _rpmNoSignature = yesNo_r; return *this; }
00069 
00071     ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r = true )
00072     { _syncPoolAfterCommit = yesNo_r; return *this; }
00073 
00074   private:
00075     unsigned _restrictToMedia;
00076     bool     _dryRun;
00077     bool     _rpmNoSignature;
00078     bool     _syncPoolAfterCommit;
00079   };
00081 
00083   std::ostream & operator<<( std::ostream & str, const ZYppCommitPolicy & obj );
00084 
00086 } // namespace zypp
00088 #endif // ZYPP_ZYPPCOMMITPOLICY_H

Generated on Tue Sep 25 19:23:11 2007 for libzypp by  doxygen 1.5.3