Add more tests for exclude validation

This commit is contained in:
Patrick Niklaus
2017-08-18 21:42:05 +00:00
committed by Patrick Niklaus
parent 0c838fb60c
commit 27324d0270
7 changed files with 55 additions and 4 deletions
+9
View File
@@ -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();
}
}
}