aboutsummaryrefslogtreecommitdiff
path: root/src/rule.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rule.h')
-rw-r--r--src/rule.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/rule.h b/src/rule.h
new file mode 100644
index 0000000..a3c9344
--- /dev/null
+++ b/src/rule.h
@@ -0,0 +1,53 @@
1#ifndef RULE_H
2#define RULE_H
3
4#include "types.h"
5#include <bu/formatter.h>
6
7class Rule
8{
9 friend Bu::Formatter &operator<<( Bu::Formatter &f, const Rule &t );
10public:
11 Rule( const Bu::FString &sName );
12 virtual ~Rule();
13
14 const Bu::FString &getName() const;
15
16 void setInput( const AstBranch *pNewInput );
17 const AstBranch *getInput() const;
18
19 bool hasOutputs() const;
20
21 void addOutput( const AstBranch *pNewOutput );
22 void addProfile( const AstBranch *pProfile );
23
24 void prepTarget( class Target *pTarget );
25 class Target *createTarget( class Runner &r, const Bu::FString &sInput );
26 bool ruleMatches( class Runner &r, const Bu::FString &sInput );
27
28 void addTag( const Bu::FString &sTag );
29 const StrList &getTagList() const;
30
31 void setDisplay( const Bu::FString &sStr );
32 const Bu::FString &getDisplay() const;
33
34 void addRequires( const AstBranch *pBr );
35
36private:
37 Bu::FString sName;
38 Bu::FString sDisplay;
39 const AstBranch *pInput;
40 AstBranchList lOutput;
41 ProfileHash hProfiles;
42 StrList lsTags;
43 AstBranchList lRequires;
44};
45
46Bu::Formatter &operator<<( Bu::Formatter &f, const Rule &t );
47
48namespace Bu
49{
50 template<> Bu::Formatter &operator<< <Rule>( Bu::Formatter &f, const Rule *t );
51};
52
53#endif