13
0
livetrax/libs/pbd3/basename.cc
Taybin Rutkin 9fdc36bac5 Merged timbyr's win32 branch. -r 547:566.
git-svn-id: svn://localhost/ardour2/trunk@567 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-06-07 14:54:12 +00:00

21 lines
416 B
C++

#include <iostream>
#include <string.h>
#include <pbd/basename.h>
// implement this using Glib::path_get_basename
std::string
PBD::basename_nosuffix (const std::string& str)
{
std::string::size_type slash = str.find_last_of ('/');
std::string noslash;
if (slash == std::string::npos) {
noslash = str;
} else {
noslash = str.substr (slash+1);
}
return noslash.substr (0, noslash.find_last_of ('.'));
}