aboutsummaryrefslogtreecommitdiff
path: root/src/action.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-08-18 17:21:02 +0000
committerMike Buland <eichlan@xagasoft.com>2006-08-18 17:21:02 +0000
commitdf5286fe3bca619beb4771da1ffa8ace9613e9e5 (patch)
tree0ad268267325c586527b8d36461ab0040e9ae8ec /src/action.cpp
parent4f94dfde7cbe043dfeb11a8712636bac348d3177 (diff)
downloadbuild-df5286fe3bca619beb4771da1ffa8ace9613e9e5.tar.gz
build-df5286fe3bca619beb4771da1ffa8ace9613e9e5.tar.bz2
build-df5286fe3bca619beb4771da1ffa8ace9613e9e5.tar.xz
build-df5286fe3bca619beb4771da1ffa8ace9613e9e5.zip
Gutted, deleted almost all the source, too many changes to keep it around, we'll
see what happens next.
Diffstat (limited to '')
-rw-r--r--src/action.cpp63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/action.cpp b/src/action.cpp
deleted file mode 100644
index 51868eb..0000000
--- a/src/action.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
1#include "action.h"
2#include "command.h"
3#include "builder.h"
4
5Action::Action() :
6 bDefault( true ),
7 sName("")
8{
9}
10
11Action::Action( const char *sName ) :
12 bDefault( false ),
13 sName( sName )
14{
15}
16
17Action::~Action()
18{
19}
20
21void Action::add( Command *pCmd )
22{
23 lCommand.push_back( pCmd );
24}
25
26void Action::add( int nType, const char *sCmd )
27{
28 lRegExCommand.push_back( std::pair<int,std::string>( nType, sCmd ) );
29}
30
31void Action::debug()
32{
33 if( bDefault )
34 printf(" action default:\n");
35 else
36 printf(" action \"%s\":\n", sName.getString() );
37
38 for( std::list<Command *>::iterator i = lCommand.begin();
39 i != lCommand.end(); i++ )
40 {
41 (*i)->debug();
42 }
43}
44
45void Action::execute( Builder &bld )
46{
47 for( std::list<std::pair<int,std::string> >::iterator i =
48 lRegExCommand.begin(); i != lRegExCommand.end(); i++ )
49 {
50 std::list<std::string> lTmp = bld.findTargets( (*i).second.c_str() );
51 for( std::list<std::string>::iterator j = lTmp.begin();
52 j != lTmp.end(); j++ )
53 {
54 add( new Command( (Command::CmdType)(*i).first, (*j).c_str() ) );
55 }
56 }
57 for( std::list<Command *>::iterator i = lCommand.begin();
58 i != lCommand.end(); i++ )
59 {
60 (*i)->execute( bld );
61 }
62}
63