Add more tests for exclude validation
This commit is contained in:
committed by
Patrick Niklaus
parent
0c838fb60c
commit
27324d0270
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "util/bit_range.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cstdint>
|
||||
|
||||
namespace osrm
|
||||
@@ -24,6 +26,13 @@ inline auto getClassData(const std::size_t index)
|
||||
BOOST_ASSERT(index <= MAX_CLASS_INDEX);
|
||||
return uint8_t{1} << index;
|
||||
}
|
||||
|
||||
inline bool isValidClassName(const std::string &name)
|
||||
{
|
||||
return std::find_if_not(name.begin(), name.end(), [](const auto c) {
|
||||
return std::isalnum(c);
|
||||
}) == name.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user