[routing] Make GetUserRouteNames return an ordered vector

Signed-off-by: Fábio Gomes <gabriel.gomes@tecnico.ulisboa.pt>
This commit is contained in:
Fábio Gomes 2024-06-21 09:54:23 +01:00
parent 3f4b28704c
commit ea4da2a82a

View file

@ -1591,6 +1591,13 @@ vector<string> RoutingManager::GetUserRouteNames()
continue;
routeNames.push_back(name.substr(0, idx)); // string without extension
}
auto compareFunc = [](string s1, string s2)
{
std::transform(s1.begin(), s1.end(), s1.begin(), ::toupper);
std::transform(s2.begin(), s2.end(), s2.begin(), ::toupper);
return s1.compare(s2) < 0;
};
std::sort(routeNames.begin(), routeNames.end(), compareFunc);
return routeNames;
}