aboutsummaryrefslogtreecommitdiff
path: root/src/functionfilename.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/functionfilename.cpp')
-rw-r--r--src/functionfilename.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/functionfilename.cpp b/src/functionfilename.cpp
new file mode 100644
index 0000000..21a4655
--- /dev/null
+++ b/src/functionfilename.cpp
@@ -0,0 +1,36 @@
1#include "functionfilename.h"
2
3FunctionFileName::FunctionFileName()
4{
5}
6
7FunctionFileName::~FunctionFileName()
8{
9}
10
11Bu::FString FunctionFileName::getName() const
12{
13 return "fileName";
14}
15
16Variable FunctionFileName::call( Variable &input, VarList /*lParams*/ )
17{
18 Bu::FString sFile;
19 sFile = input.getString();
20
21 Bu::FString::const_iterator i = sFile.begin();
22 for(;;)
23 {
24 Bu::FString::const_iterator b = i.find('/');
25 if( !b )
26 {
27 return Variable( Bu::FString( i ) );
28 }
29 i = b+1;
30 if( !i )
31 {
32 return Variable( Bu::FString( i ) );
33 }
34 }
35}
36