1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 21:59:55 +00:00
openmw/components/misc/pathhelpers.hpp

19 lines
404 B
C++

#ifndef OPENMW_COMPONENTS_MISC_PATHHELPERS_H
#define OPENMW_COMPONENTS_MISC_PATHHELPERS_H
#include <string>
namespace Misc
{
inline std::string_view getFileExtension(std::string_view file)
{
if (auto extPos = file.find_last_of('.'); extPos != std::string::npos)
{
file.remove_prefix(extPos + 1);
return file;
}
return {};
}
}
#endif