]> cygwin.com Git - cygwin-apps/setup.git/blob - prereq.h
163af6ebbbbab58e7ca5eefe9a1374d6591b4724
[cygwin-apps/setup.git] / prereq.h
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 )
15 { return casecompare(m1->name, m2->name) < 0; }
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 ();
30 private:
31 long whatNext ();
32 };
33
34 class PrereqChecker
35 {
36 public:
37 // checks all dependecies, populates 'unmet'
38 // returns true if unsatisfied dependencies exist
39 bool isMet ();
40
41 // formats 'unmet' as a string for display
42 void getUnmetString (std::string &s);
43
44 // selects/picks the needed packages that were missing
45 void selectMissing ();
46
47 // notes the current trust (for use in selectMissing)
48 static void setTrust (trusts t) { theTrust = t; };
49
50 private:
51
52 // this is the actual hash_map that does all the work
53 static map <packagemeta *, vector <packagemeta *>, packagemeta_ltcomp> unmet;
54 static map <std::string, vector <packagemeta *> > notfound;
55 static trusts theTrust;
56 };
57
58 #endif /* SETUP_PREREQ_H */
This page took 0.035776 seconds and 5 git commands to generate.