Last change
on this file since 145 was
145,
checked in by rosiere, 14 years ago
|
1) add test with SPECINT2K
2) new config of Selftest
3) modif RAT to support multiple depth_save ... but not finish (need fix Update Prediction Table)
4) add Function_pointer but need fix
|
-
Property svn:keywords set to
Id
|
File size:
537 bytes
|
Line | |
---|
1 | /* |
---|
2 | * $Id: Basename.cpp 145 2010-10-13 18:15:51Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "../include/Basename.h" |
---|
9 | //#include <libgen.h> |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | |
---|
13 | std::string basename (std::string str, bool keep_extension) |
---|
14 | { |
---|
15 | std::string res = ::basename(const_cast<char *>(str.c_str())); |
---|
16 | |
---|
17 | if (not keep_extension) |
---|
18 | { |
---|
19 | std::string::size_type index = res.rfind('.'); |
---|
20 | |
---|
21 | if(index != std::string::npos) |
---|
22 | { |
---|
23 | res = res.substr(0,index); |
---|
24 | } |
---|
25 | } |
---|
26 | |
---|
27 | return res; |
---|
28 | } |
---|
29 | |
---|
30 | }; // end namespace morpheo |
---|
Note: See
TracBrowser
for help on using the repository browser.