use ustring more; handle embedding of "paired" files as per mantis #1362

git-svn-id: svn://localhost/ardour2/trunk@1241 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-12-21 18:38:00 +00:00
parent 2202912d35
commit afa29d3190
17 changed files with 325 additions and 196 deletions

View file

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