diff options
Diffstat (limited to 'src/functionfilename.cpp')
-rw-r--r-- | src/functionfilename.cpp | 36 |
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 | |||
3 | FunctionFileName::FunctionFileName() | ||
4 | { | ||
5 | } | ||
6 | |||
7 | FunctionFileName::~FunctionFileName() | ||
8 | { | ||
9 | } | ||
10 | |||
11 | Bu::FString FunctionFileName::getName() const | ||
12 | { | ||
13 | return "fileName"; | ||
14 | } | ||
15 | |||
16 | Variable 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 | |||