aboutsummaryrefslogtreecommitdiff
path: root/src/functionunlink.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-12-21 18:04:02 +0000
committerMike Buland <eichlan@xagasoft.com>2009-12-21 18:04:02 +0000
commitfb28f6800864176be2ffca29e8e664b641f33170 (patch)
treeba9180ac442939edc4eacbe1fdae93c5a7f87cee /src/functionunlink.cpp
parent51e21a316be6e052251b3dfc7d671061ebd67cee (diff)
downloadbuild-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 '')
-rw-r--r--src/functionunlink.cpp51
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>
6using namespace Bu;
7
8FunctionUnlink::FunctionUnlink()
9{
10}
11
12FunctionUnlink::~FunctionUnlink()
13{
14}
15
16Bu::FString FunctionUnlink::getName() const
17{
18 return "unlink";
19}
20
21Variable 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