aboutsummaryrefslogtreecommitdiff
path: root/src/functionread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/functionread.cpp')
-rw-r--r--src/functionread.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/functionread.cpp b/src/functionread.cpp
index b9c8397..a59519c 100644
--- a/src/functionread.cpp
+++ b/src/functionread.cpp
@@ -3,7 +3,7 @@
3 3
4#include <bu/plugger.h> 4#include <bu/plugger.h>
5PluginInterface3( pluginFunctionRead, read, FunctionRead, Function, 5PluginInterface3( pluginFunctionRead, read, FunctionRead, Function,
6 "Mike Buland", 0, 1 ); 6 "Mike Buland", 0, 1 );
7 7
8FunctionRead::FunctionRead() 8FunctionRead::FunctionRead()
9{ 9{
@@ -15,26 +15,26 @@ FunctionRead::~FunctionRead()
15 15
16Bu::String FunctionRead::getName() const 16Bu::String FunctionRead::getName() const
17{ 17{
18 return "read"; 18 return "read";
19} 19}
20 20
21Variable FunctionRead::call( Variable &input, VarList lParams ) 21Variable FunctionRead::call( Variable &input, VarList lParams )
22{ 22{
23 Variable vRet; 23 Variable vRet;
24 if( lParams.getSize() == 1 ) 24 if( lParams.getSize() == 1 )
25 { 25 {
26 int iSize = lParams.first().toInt(); 26 int iSize = lParams.first().toInt();
27 Bu::String sBuf( iSize ); 27 Bu::String sBuf( iSize );
28 sBuf.resize( 28 sBuf.resize(
29 FileMgr::getInstance().get( (ptrdiff_t)input.getOpaque() ).read( 29 FileMgr::getInstance().get( (ptrdiff_t)input.getOpaque() ).read(
30 sBuf.getStr(), iSize 30 sBuf.getStr(), iSize
31 ) 31 )
32 ); 32 );
33 vRet = sBuf; 33 vRet = sBuf;
34 return vRet; 34 return vRet;
35 } 35 }
36 throw Bu::ExceptionBase( 36 throw Bu::ExceptionBase(
37 "read takes zero or one parameters." 37 "read takes zero or one parameters."
38 ); 38 );
39} 39}
40 40