Replace suffix implementation with std::filesystem

This commit is contained in:
Luis Díaz Más
2022-02-14 21:21:33 +01:00
committed by Luis Diaz
parent 2c51208622
commit dad3e7f5c4
+1 -6
View File
@@ -48,12 +48,7 @@ namespace Util {
std::string suffix(const std::string& path)
{
std::string b = basename(path);
std::string::size_type idx = b.rfind('.');
if (idx == std::string::npos || idx == 0 || idx == b.length()-1) {
return "";
}
return b.substr(idx);
return fs::path(path).extension().string();
}
} // namespace Util