20 const std::size_t slash_pos = in.find_last_of(
"\\/");
22 const std::size_t slash_pos = in.rfind(
'/');
25 std::size_t start_pos =
26 (slash_pos == std::string::npos) ? 0 : slash_pos + 1;
28 std::size_t char_count = std::string::npos;
32 std::size_t dot_pos = in.rfind(
'.');
33 if(dot_pos != std::string::npos && dot_pos >= start_pos)
34 char_count = dot_pos - start_pos;
37 return std::string(in, start_pos, char_count);
std::string get_base_name(const std::string &in, bool strip_suffix)
cleans a filename from path and extension