aboutsummaryrefslogtreecommitdiff
path: root/src/rule.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/rule.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/rule.h b/src/rule.h
index 8371649..8246cc9 100644
--- a/src/rule.h
+++ b/src/rule.h
@@ -4,9 +4,11 @@
4#include <list> 4#include <list>
5#include <string> 5#include <string>
6#include <stdint.h> 6#include <stdint.h>
7#include <regex.h> 7#include "regexp.h"
8#include "staticstring.h" 8#include "staticstring.h"
9 9
10class Perform;
11
10class Rule 12class Rule
11{ 13{
12public: 14public:
@@ -16,7 +18,7 @@ public:
16 matchAll 18 matchAll
17 }; 19 };
18 20
19 enum Perform 21 enum ePerform
20 { 22 {
21 perfCommand 23 perfCommand
22 }; 24 };
@@ -34,20 +36,27 @@ public:
34 36
35 void addProduces( const char *sProduces ); 37 void addProduces( const char *sProduces );
36 void setMatches( Matches how, const char *sWhat ); 38 void setMatches( Matches how, const char *sWhat );
37 void setPerforms( Perform pwhat, const char *sPerfCmd ); 39 void setPerforms( ePerform pwhat, const char *sPerfCmd );
40
41 bool willChain( Rule *pRule );
38 42
39 std::list<std::string> execute( class Builder &bld, std::list<std::string> lInput ); 43 std::list<std::string> execute( class Builder &bld, std::list<std::string> lInput, const char *sTarget=NULL );
40 44
41private: 45private:
46 class Perform *buildCommand( class Builder &bld, const char *sCmd, const char *sTarget, const char *sMatches );
47 std::list<std::string> findTargets( class Builder &bld, std::list<std::string> &lIn, std::string &sMatches, const char *sTarget );
42 StaticString sName; 48 StaticString sName;
43 std::list<std::string> lProduces; 49 std::list<std::string> lProduces;
44 50
45 Matches mHow; 51 Matches mHow;
46 StaticString sWhat; 52 RegExp rWhat;
47 regex_t rWhat; 53 //StaticString sWhat;
54 //regex_t rWhat;
48 55
49 Perform pHow; 56 ePerform pHow;
50 StaticString sPerfCmd; 57 StaticString sPerfCmd;
58
59 bool bNoProduces;
51}; 60};
52 61
53#endif 62#endif