aboutsummaryrefslogtreecommitdiff
path: root/src/functiontostring.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/functiontostring.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/functiontostring.cpp b/src/functiontostring.cpp
index bc5db6c..b3ffb5b 100644
--- a/src/functiontostring.cpp
+++ b/src/functiontostring.cpp
@@ -6,7 +6,7 @@ using namespace Bu;
6 6
7#include <bu/plugger.h> 7#include <bu/plugger.h>
8PluginInterface3( pluginFunctionToString, toString, FunctionToString, Function, 8PluginInterface3( pluginFunctionToString, toString, FunctionToString, Function,
9 "Mike Buland", 0, 1 ); 9 "Mike Buland", 0, 1 );
10 10
11FunctionToString::FunctionToString() 11FunctionToString::FunctionToString()
12{ 12{
@@ -18,37 +18,37 @@ FunctionToString::~FunctionToString()
18 18
19Bu::String FunctionToString::getName() const 19Bu::String FunctionToString::getName() const
20{ 20{
21 return "toString"; 21 return "toString";
22} 22}
23 23
24Variable FunctionToString::call( Variable &input, VarList lParams ) 24Variable FunctionToString::call( Variable &input, VarList lParams )
25{ 25{
26 Bu::String sStr; 26 Bu::String sStr;
27 Bu::String sSep; 27 Bu::String sSep;
28 if( lParams.getSize() == 0 ) 28 if( lParams.getSize() == 0 )
29 { 29 {
30 sSep = " "; 30 sSep = " ";
31 } 31 }
32 else 32 else
33 { 33 {
34 sSep = lParams.first().getString(); 34 sSep = lParams.first().getString();
35 } 35 }
36 switch( input.getType() ) 36 switch( input.getType() )
37 { 37 {
38 case Variable::typeString: 38 case Variable::typeString:
39 return input; 39 return input;
40 40
41 case Variable::typeList: 41 case Variable::typeList:
42 for( VarList::iterator i = input.begin(); i; i++ ) 42 for( VarList::iterator i = input.begin(); i; i++ )
43 { 43 {
44 if( i != input.begin() ) 44 if( i != input.begin() )
45 sStr += sSep; 45 sStr += sSep;
46 sStr += (*i).getString(); 46 sStr += (*i).getString();
47 } 47 }
48 return Variable( sStr ); 48 return Variable( sStr );
49 49
50 default: 50 default:
51 return Variable( input.getString() ); 51 return Variable( input.getString() );
52 } 52 }
53} 53}
54 54