pulling trunk
[ardour.git] / libs / pbd3 / basename.cc
1 #include <iostream>
2 #include <string.h>
3 #include <pbd/basename.h>
4
5
6 // implement this using Glib::path_get_basename
7 std::string 
8 PBD::basename_nosuffix (const std::string& str)
9 {
10         std::string::size_type slash = str.find_last_of ('/');
11         std::string noslash;
12
13         if (slash == std::string::npos) {
14                 noslash = str;
15         } else {
16                 noslash = str.substr (slash+1);
17         }
18
19         return noslash.substr (0, noslash.find_last_of ('.'));
20 }