1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

small refactoring

This commit is contained in:
Laserlicht
2025-06-22 00:20:03 +02:00
parent de893a3575
commit bd090059da
4 changed files with 19 additions and 29 deletions

View File

@@ -423,4 +423,18 @@ boost::filesystem::path TextOperations::Utf8TofilesystemPath(const std::string&
#endif
}
std::string TextOperations::convertMapName(std::string input)
{
boost::algorithm::to_lower(input);
boost::algorithm::trim(input);
boost::algorithm::erase_all(input, ".");
size_t slashPos = input.find_last_of('/');
if(slashPos != std::string::npos)
return input.substr(slashPos + 1);
return input;
}
VCMI_LIB_NAMESPACE_END