#ifndef RULE_H #define RULE_H #include #include #include #include "regexp.h" #include "staticstring.h" #include "builder.h" class Perform; class Rule { public: enum Matches { matchOne, matchAll }; enum ePerform { perfCommand }; public: Rule( const char *sName ); virtual ~Rule(); const char *getName() { return sName; } void debug(); void addProduces( const char *sProduces ); void setMatches( Matches how, const char *sWhat ); void setPerforms( ePerform pwhat, const char *sPerfCmd ); bool willChain( Rule *pRule ); std::list execute( class Builder &bld, std::list lInput, std::list &lPerf, const char *sTarget=NULL ); private: class Perform *buildCommand( class Builder &bld, const char *sCmd, Builder::varmap *vars ); std::list findTargets( class Builder &bld, std::list &lIn, std::string &sMatches, const char *sTarget ); StaticString sName; std::list lProduces; Matches mHow; RegExp rWhat; //StaticString sWhat; //regex_t rWhat; ePerform pHow; StaticString sPerfCmd; bool bNoProduces; }; #endif