aboutsummaryrefslogtreecommitdiff
path: root/src/functionwrite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/functionwrite.cpp')
-rw-r--r--src/functionwrite.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/functionwrite.cpp b/src/functionwrite.cpp
new file mode 100644
index 0000000..7abb661
--- /dev/null
+++ b/src/functionwrite.cpp
@@ -0,0 +1,34 @@
1#include "functionwrite.h"
2#include "filemgr.h"
3
4#include <bu/plugger.h>
5PluginInterface3( pluginFunctionWrite, write, FunctionWrite, Function,
6 "Mike Buland", 0, 1 );
7
8FunctionWrite::FunctionWrite()
9{
10}
11
12FunctionWrite::~FunctionWrite()
13{
14}
15
16Bu::String FunctionWrite::getName() const
17{
18 return "write";
19}
20
21Variable FunctionWrite::call( Variable &input, VarList lParams )
22{
23 if( lParams.getSize() != 1 )
24 {
25 throw Bu::ExceptionBase(
26 "write takes one parameter, the string to write."
27 );
28 }
29 FileMgr::getInstance().get( (int)input.getOpaque() ).write(
30 lParams.first().toString()
31 );
32 return Variable();
33}
34