#include <string>


Go to the source code of this file.
Functions | |
| std::string | baseName (const std::string &str) |
| std::string baseName | ( | const std::string & | str | ) | [inline] |
Gets the basename of a file (removing the directory)
| str | given path |
Definition at line 32 of file BaseName.hpp.
Referenced by CommandLineParser::showUsage().
00033 { 00034 size_t begin = 0; 00035 size_t end = str.length(); 00036 00037 for (size_t i=0; i<str.length(); ++i) { 00038 if (str[i] == '/') begin = i+1; 00039 } 00040 00041 return str.substr(begin,end); 00042 }
1.5.6