3 #include <boost/algorithm/string.hpp>
9 std::pair<bool, std::string>
endsWith(std::string
const& s,
const std::vector<std::string>& patterns) {
10 for(
auto& p : patterns) {
11 if(boost::algorithm::ends_with(s, p)) {
12 return std::pair<bool, std::string>{
true, p};
15 return std::pair<bool, std::string>{
false,
""};
22 if(!boost::starts_with(s,
"doocs://")) {
23 nSlashes = std::count(s.begin(), s.end(),
'/');
26 nSlashes = std::count(s.begin(), s.end(),
'/') - 3;