-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
143 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#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 ¶m, | ||
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; | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters