osrm-backend/include/server/service/utils.hpp
Daniel Patterson 50d9632ed7
Upgrade formatting to clang-format 10 (#5895)
* Update formatting tools to clang-format-10

* Reformat using clang-format-10.0.09
2020-11-26 07:21:39 -08:00

30 lines
744 B
C++

#include <boost/format.hpp>
namespace osrm
{
namespace server
{
namespace service
{
const constexpr char PARAMETER_SIZE_MISMATCH_MSG[] =
"Number of elements in %1% size %2% does not match coordinate size %3%";
template <typename ParamT>
bool constrainParamSize(const char *msg_template,
const char *name,
const ParamT &param,
const std::size_t target_size,
std::string &help)
{
if (param.size() > 0 && param.size() != target_size)
{
help = (boost::format(msg_template) % name % param.size() % target_size).str();
return true;
}
return false;
}
} // namespace service
} // namespace server
} // namespace osrm