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: 00053 ZYppCommitPolicy & restrictToMedia( unsigned mediaNr_r ) 00054 { _restrictToMedia = mediaNr_r; return *this; } 00055 00057 ZYppCommitPolicy & allMedia() 00058 { return restrictToMedia( 0 ); } 00059 00061 ZYppCommitPolicy & dryRun( bool yesNo_r = true ) 00062 { _dryRun = yesNo_r; return *this; } 00063 00065 ZYppCommitPolicy & rpmNoSignature( bool yesNo_r = true ) 00066 { _rpmNoSignature = yesNo_r; return *this; } 00067 00069 ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r = true ) 00070 { _syncPoolAfterCommit = yesNo_r; return *this; } 00071 00072 private: 00073 unsigned _restrictToMedia; 00074 bool _dryRun; 00075 bool _rpmNoSignature; 00076 bool _syncPoolAfterCommit; 00077 }; 00079 00081 std::ostream & operator<<( std::ostream & str, const ZYppCommitPolicy & obj ); 00082 00084 } // namespace zypp 00086 #endif // ZYPP_ZYPPCOMMITPOLICY_H
1.5.0