]>
Commit | Line | Data |
---|---|---|
82306ac2 BD |
1 | #ifndef SETUP_PREREQ_H |
2 | #define SETUP_PREREQ_H | |
3 | ||
4 | #include <map> | |
5 | #include "proppage.h" | |
6 | #include "PackageTrust.h" | |
7 | #include "package_meta.h" | |
8 | ||
9 | using namespace std; | |
10 | ||
11 | // keeps the map sorted by name | |
12 | struct packagemeta_ltcomp | |
13 | { | |
14 | bool operator() ( const packagemeta *m1, const packagemeta *m2 ) | |
afa76033 | 15 | { return casecompare(m1->name, m2->name) < 0; } |
82306ac2 BD |
16 | }; |
17 | ||
18 | ||
19 | class PrereqPage:public PropertyPage | |
20 | { | |
21 | public: | |
22 | PrereqPage (); | |
23 | virtual ~PrereqPage () { }; | |
24 | bool Create (); | |
25 | virtual void OnInit (); | |
26 | virtual void OnActivate (); | |
27 | virtual long OnNext (); | |
28 | virtual long OnBack (); | |
29 | virtual long OnUnattended () { return 0; }; | |
30 | }; | |
31 | ||
32 | class PrereqChecker | |
33 | { | |
34 | public: | |
35 | // checks all dependecies, populates 'unmet' | |
36 | // returns true if unsatisfied dependencies exist | |
37 | bool isMet (); | |
38 | ||
39 | // formats 'unmet' as a string for display | |
08678720 | 40 | void getUnmetString (std::string &s); |
82306ac2 BD |
41 | |
42 | // selects/picks the needed packages that were missing | |
43 | void selectMissing (); | |
44 | ||
45 | // notes the current trust (for use in selectMissing) | |
46 | void setTrust (trusts t) { theTrust = t; }; | |
47 | ||
48 | private: | |
49 | ||
50 | // this is the actual hash_map that does all the work | |
51 | static map <packagemeta *, vector <packagemeta *>, packagemeta_ltcomp> unmet; | |
52 | static trusts theTrust; | |
53 | }; | |
54 | ||
55 | #endif /* SETUP_PREREQ_H */ |