From fb28f6800864176be2ffca29e8e664b641f33170 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 21 Dec 2009 18:04:02 +0000 Subject: m3 is copied into trunk, we should be good to go, now. --- src/functionunlink.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/functionunlink.cpp (limited to 'src/functionunlink.cpp') 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 @@ +#include "functionunlink.h" + +#include +#include +#include +using namespace Bu; + +FunctionUnlink::FunctionUnlink() +{ +} + +FunctionUnlink::~FunctionUnlink() +{ +} + +Bu::FString FunctionUnlink::getName() const +{ + return "unlink"; +} + +Variable FunctionUnlink::call( Variable &/*input*/, VarList lParams ) +{ + //sio << "Unlink called: " << lParams << sio.nl; + for( VarList::iterator p = lParams.begin(); p; p++ ) + { + switch( (*p).getType() ) + { + case Variable::typeString: + //sio << " xx> " << (*p).getString() << sio.nl; + unlink( (*p).getString().getStr() ); + break; + + case Variable::typeList: + //sio << " xx>"; + for( VarList::iterator i = (*p).begin(); i; i++ ) + { + //sio << " " << (*i).getString(); + unlink( (*i).getString().getStr() ); + } + //sio << sio.nl; + break; + + default: + throw Bu::ExceptionBase("Hey, wrong type passed."); + break; + } + } + + return Variable(); +} + -- cgit v1.2.3