]> git.tdb.fi Git - builder.git/blob - source/condition.h
Add SubTool class
[builder.git] / source / condition.h
1 #ifndef CONDITION_H_
2 #define CONDITION_H_
3
4 #include <msp/datafile/loader.h>
5 #include "buildinfo.h"
6 #include "misc.h"
7
8 class Config;
9 class SourcePackage;
10
11 class Condition
12 {
13 public:
14         class Loader: public Msp::DataFile::Loader
15         {
16         private:
17                 Condition &cond;
18
19         public:
20                 Loader(Condition &);
21         private:
22                 void require(const std::string &);
23                 void build_info();
24         };
25
26 private:
27         SourcePackage &pkg;
28         StringMap expression;
29         StringList requires;
30         BuildInfo build_info;
31
32 public:
33         Condition(SourcePackage &, const std::string &);
34         const StringList &get_requires() const { return requires; }
35         const BuildInfo &get_build_info() const { return build_info; }
36         bool eval();
37 };
38 typedef std::list<Condition> ConditionList;
39
40 #endif