summaryrefslogtreecommitdiff
path: root/src/locker.h
blob: d7d5a9bb5ce45f4e048bdaf17c720767b1ce1fc0 (plain)
    1 ////////////////////////////////////////////////////////////////////////
    2 // FILE:        locker.h
    3 // AUTHOR:      Johannes Winkelmann, jw@tks6.net
    4 // COPYRIGHT:   (c) 2002 by Johannes Winkelmann
    5 // ---------------------------------------------------------------------
    6 //  This program is free software; you can redistribute it and/or modify
    7 //  it under the terms of the GNU General Public License as published by
    8 //  the Free Software Foundation; either version 2 of the License, or
    9 //  (at your option) any later version.
   10 ////////////////////////////////////////////////////////////////////////
   11 
   12 #ifndef _LOCKER_H_
   13 #define _LOCKER_H_
   14 
   15 #include <string>
   16 #include <vector>
   17 
   18 using namespace std;
   19 
   20 /**
   21  * prt-get can place packages in the locker, which are then not updated
   22  * anymore.
   23  * Locked packages are:
   24  * - marked in prt-get diff
   25  * - not shown in prt-get quickdiff
   26  * - not updated in prt-get sysup
   27  * 
   28  * remember to call store!
   29  */
   30 class Locker
   31 {
   32 public:
   33     Locker();
   34 
   35     bool store();
   36 
   37     bool lock( const string& package );
   38     bool unlock( const string& package );
   39     bool isLocked( const string& package ) const;
   40 
   41     const vector<string>& lockedPackages() const;
   42 
   43     bool openFailed() const;
   44 private:
   45 
   46     vector<string> m_packages;
   47     static const string LOCKER_FILE;
   48     static const string LOCKER_FILE_PATH;
   49 
   50     bool m_openFailed;
   51 };
   52 
   53 #endif /* _LOCKER_H_ */

Generated by cgit