]> git.tdb.fi Git - builder.git/blob - source/condition.h
Pass the full path to the Build file to SourcePackage and create a target for it
[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::ObjectLoader<Condition>
15         {
16         public:
17                 Loader(Condition &);
18         private:
19                 void require(const std::string &);
20                 void build_info();
21         };
22
23 private:
24         SourcePackage &pkg;
25         StringMap expression;
26         StringList requires;
27         BuildInfo build_info;
28
29 public:
30         Condition(SourcePackage &, const std::string &);
31         const StringList &get_requires() const { return requires; }
32         const BuildInfo &get_build_info() const { return build_info; }
33         bool eval();
34 };
35 typedef std::list<Condition> ConditionList;
36
37 #endif