#ifndef BUILD_H #define BUILD_H #include #include #include #include "exceptions.h" #include "rule.h" #include "target.h" #include "action.h" #include "stringproc.h" subExceptionDecl( BuildException ); typedef std::map VarMap; class Build { public: Build(); virtual ~Build(); void execAction( const std::string &sWhat ); /** * Adds a target to the build. If the target already exists, this will * attempt to merge them as best it can. If there are any conflicts, it * will throw an exception. *@param pTarget A pointer to a Target object that Build takes ownership of. */ void addTarget( Target *pTarget ); void addRequires( const std::string &who, const std::string &what ); void addRule( Rule *pRule ); void addAction( Action *pAction ); void set( const std::string &cont, const std::string &var, const std::string &val ); void setAdd( const std::string &cont, const std::string &var, const std::string &val ); std::string getVar( const std::string &cont, const std::string &var, VarMap *mExtra ); Rule *getRule( const std::string &name ); void debugDump(); void setStringProc( StringProc *pStrProc ); std::string replVars( const std::string &sSrc, const std::string &sCont, VarMap *mExtra ); private: typedef std::map TargetMap; typedef std::list StringList; typedef std::map ReqMap; typedef std::map ContextMap; typedef std::map RuleMap; typedef std::map ActionMap; TargetMap mTarget; ReqMap mRequires; VarMap mVars; ContextMap mContVars; RuleMap mRule; ActionMap mAction; StringProc *pStrProc; //std::map mRule; //Action *pActDefault; //std::map mAction; }; #endif