diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 18:04:02 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 18:04:02 +0000 |
commit | fb28f6800864176be2ffca29e8e664b641f33170 (patch) | |
tree | ba9180ac442939edc4eacbe1fdae93c5a7f87cee /src/functionunlink.cpp | |
parent | 51e21a316be6e052251b3dfc7d671061ebd67cee (diff) | |
download | build-fb28f6800864176be2ffca29e8e664b641f33170.tar.gz build-fb28f6800864176be2ffca29e8e664b641f33170.tar.bz2 build-fb28f6800864176be2ffca29e8e664b641f33170.tar.xz build-fb28f6800864176be2ffca29e8e664b641f33170.zip |
m3 is copied into trunk, we should be good to go, now.
Diffstat (limited to 'src/functionunlink.cpp')
-rw-r--r-- | src/functionunlink.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/functionunlink.cpp b/src/functionunlink.cpp new file mode 100644 index 0000000..addcfd9 --- /dev/null +++ b/src/functionunlink.cpp | |||
@@ -0,0 +1,51 @@ | |||
1 | #include "functionunlink.h" | ||
2 | |||
3 | #include <unistd.h> | ||
4 | #include <stdlib.h> | ||
5 | #include <bu/sio.h> | ||
6 | using namespace Bu; | ||
7 | |||
8 | FunctionUnlink::FunctionUnlink() | ||
9 | { | ||
10 | } | ||
11 | |||
12 | FunctionUnlink::~FunctionUnlink() | ||
13 | { | ||
14 | } | ||
15 | |||
16 | Bu::FString FunctionUnlink::getName() const | ||
17 | { | ||
18 | return "unlink"; | ||
19 | } | ||
20 | |||
21 | Variable FunctionUnlink::call( Variable &/*input*/, VarList lParams ) | ||
22 | { | ||
23 | //sio << "Unlink called: " << lParams << sio.nl; | ||
24 | for( VarList::iterator p = lParams.begin(); p; p++ ) | ||
25 | { | ||
26 | switch( (*p).getType() ) | ||
27 | { | ||
28 | case Variable::typeString: | ||
29 | //sio << " xx> " << (*p).getString() << sio.nl; | ||
30 | unlink( (*p).getString().getStr() ); | ||
31 | break; | ||
32 | |||
33 | case Variable::typeList: | ||
34 | //sio << " xx>"; | ||
35 | for( VarList::iterator i = (*p).begin(); i; i++ ) | ||
36 | { | ||
37 | //sio << " " << (*i).getString(); | ||
38 | unlink( (*i).getString().getStr() ); | ||
39 | } | ||
40 | //sio << sio.nl; | ||
41 | break; | ||
42 | |||
43 | default: | ||
44 | throw Bu::ExceptionBase("Hey, wrong type passed."); | ||
45 | break; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | return Variable(); | ||
50 | } | ||
51 | |||