diff options
Diffstat (limited to '')
| -rw-r--r-- | src/functionwrite.cpp | 34 |
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> | ||
| 5 | PluginInterface3( pluginFunctionWrite, write, FunctionWrite, Function, | ||
| 6 | "Mike Buland", 0, 1 ); | ||
| 7 | |||
| 8 | FunctionWrite::FunctionWrite() | ||
| 9 | { | ||
| 10 | } | ||
| 11 | |||
| 12 | FunctionWrite::~FunctionWrite() | ||
| 13 | { | ||
| 14 | } | ||
| 15 | |||
| 16 | Bu::String FunctionWrite::getName() const | ||
| 17 | { | ||
| 18 | return "write"; | ||
| 19 | } | ||
| 20 | |||
| 21 | Variable 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 | |||
