Lines Matching full:url
11 #include <boost/url/segments_view.hpp>
12 #include <boost/url/url.hpp>
13 #include <boost/url/url_view_base.hpp>
37 constexpr uint64_t getParameterTag(std::string_view url)
42 for (size_t urlIndex = 0; urlIndex < url.size(); urlIndex++)
44 char character = url[urlIndex];
60 url.substr(urlSegmentIndex, urlIndex + 1 - urlSegmentIndex);
340 inline void appendUrlPieces(boost::urls::url& url, AV&&... args)
346 url.segments().push_back(arg);
396 inline bool readUrlSegments(const boost::urls::url_view_base& url,
399 const boost::urls::segments_view& urlSegments = url.segments();
409 std::string fragment = url.fragment();
415 // Url fragments start with a /, so we need to skip the first empty string
464 inline bool readUrlSegments(const boost::urls::url_view_base& url,
467 return details::readUrlSegments(url, {std::forward<Args>(args)...});
470 inline boost::urls::url replaceUrlSegment(
475 boost::urls::url url("/");
479 return url;
489 url.segments().push_back(newSegment);
493 url.segments().push_back(*it);
497 return url;
500 inline void setProtocolDefaults(boost::urls::url& url,
503 if (url.has_scheme())
509 if (url.port_number() == 443)
511 url.set_scheme("https");
513 if (url.port_number() == 80)
517 url.set_scheme("http");
523 url.set_scheme("snmp");
527 inline void setPortDefaults(boost::urls::url& url)
529 uint16_t port = url.port_number();
537 if (url.scheme() == "http")
539 url.set_port_number(80);
541 if (url.scheme() == "https")
543 url.set_port_number(443);
545 if (url.scheme() == "snmp")
547 url.set_port_number(162);
556 template <std::derived_from<boost::urls::url_view_base> URL>
557 struct adl_serializer<URL>
560 static void to_json(json& j, const URL& url)
562 j = url.buffer();