From b6d1a440d3885480e6f2e2209434e633689a4bf6 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 8 Sep 2006 19:45:14 +0000 Subject: Getting steaddily closer. --- src/perform.cpp | 11 +++++++++++ src/perform.h | 4 ++++ src/performcommand.cpp | 8 ++++++++ src/performcommand.h | 2 ++ 4 files changed, 25 insertions(+) diff --git a/src/perform.cpp b/src/perform.cpp index 4e4a78e..20ad51a 100644 --- a/src/perform.cpp +++ b/src/perform.cpp @@ -1,4 +1,5 @@ #include "perform.h" +#include "build.h" Perform::Perform() { @@ -13,3 +14,13 @@ void Perform::addParam( const char *sParam ) lParam.push_back( sParam ); } +void Perform::copyData( Perform *pSrc, Build &bld, const std::string &cont ) +{ + lParam.clear(); + for( std::list::iterator i = pSrc->lParam.begin(); + i != pSrc->lParam.end(); i++ ) + { + lParam.push_back( bld.replVars( *i, cont ) ); + } +} + diff --git a/src/perform.h b/src/perform.h index 020af42..5a961e2 100644 --- a/src/perform.h +++ b/src/perform.h @@ -5,6 +5,8 @@ #include #include +class Build; + class Perform { public: @@ -12,6 +14,8 @@ public: virtual ~Perform(); void addParam( const char *sParam ); + virtual Perform *duplicate( Build &bld, const std::string &cont ) = 0; + void copyData( Perform *pSrc, Build &bld, const std::string &cont ); private: std::list lParam; diff --git a/src/performcommand.cpp b/src/performcommand.cpp index 7c7dd42..7505061 100644 --- a/src/performcommand.cpp +++ b/src/performcommand.cpp @@ -10,3 +10,11 @@ PerformCommand::PerformCommand() PerformCommand::~PerformCommand() { } + +Perform *PerformCommand::duplicate( Build &bld, const std::string &cont ) +{ + Perform *pRet = new PerformCommand(); + pRet->copyData( this, bld, cont ); + return pRet; +} + diff --git a/src/performcommand.h b/src/performcommand.h index 219ae28..b6f7f11 100644 --- a/src/performcommand.h +++ b/src/performcommand.h @@ -11,6 +11,8 @@ public: PerformCommand(); virtual ~PerformCommand(); + virtual Perform *duplicate( Build &bld, const std::string &cont ); + private: }; -- cgit v1.2.3