File: InstallableUnit.hh

package info (click to toggle)
packup 0.6-3.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 832 kB
  • sloc: cpp: 10,857; makefile: 111; sh: 6
file content (79 lines) | stat: -rw-r--r-- 2,804 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/******************************************************************************\
 *    This file is part of packup.                                            *
 *                                                                            *
 *    packup is free software: you can redistribute it and/or modify          *
 *    it under the terms of the GNU General Public License as published by    *
 *    the Free Software Foundation, either version 3 of the License, or       *
 *    (at your option) any later version.                                     *
 *                                                                            *
 *    packup is distributed in the hope that it will be useful,               *
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 *    GNU General Public License for more details.                            *
 *                                                                            *
 *    You should have received a copy of the GNU General Public License       *
 *    along with packup.  If not, see <http://www.gnu.org/licenses/>.         *            
\******************************************************************************/           
/* 
 * File:   InstallableUnit.hh
 * Author: mikolas
 *
 * Created on September 25, 2010, 5:27 PM
 * Copyright (C) 2011, Mikolas Janota
 */

#ifndef INSTALLABLEUNIT_HH
#define	INSTALLABLEUNIT_HH
#include "collections.hh"

class InstallableUnit
{
public:
    string name;
    bool installed;
    Version version;
    PackageVersionList provides;
    PackageVersionsList conflicts;
    PackageVersionsCNF depends_cnf; // cnf that must be true because of depends
    PackageVersionsCNF recommends_cnf; // cnf that is recommended to be true because of reccommends
    KeepValue keep;

    bool needed;
    Variable variable;

    inline void dump(ostream& out)
    {
        out << "package: " << name << endl;
        out << "version: " << version << endl;
        out << "installed: " << (installed ? "true" : "false") << endl;

        out << "provides: ";
        collection_printing::print(provides,out);
        out << endl;

        out << "conflicts: ";
        collection_printing::print(conflicts,out);
        out << endl;

        out << "depends: ";
        collection_printing::print(depends_cnf,out);
        out << endl;

        out << "recommends: ";
        collection_printing::print(recommends_cnf,out);
        out << endl;

        out << "keep: " << to_string(keep) << endl;
    }
};

struct InstallableUnitCmp {
 inline bool operator()(const InstallableUnit* u1,const InstallableUnit* u2) const
 {
     return u1->version < u2->version;
 }
};


#endif	/* INSTALLABLEUNIT_HH */