49 auto schemeEnd = url.
find(
"://");
50 if (schemeEnd == std::string::npos || schemeEnd == 0) {
54 auto scheme = url.
subpiece(0, schemeEnd);
55 return std::all_of(scheme.begin(), scheme.end(), [](
auto _) {
56 return std::isalpha(
_);
118 auto queryEnd =
std::min(hashStart, std::string::npos);
119 auto pathEnd =
std::min(queryStart, hashStart);
120 auto authorityEnd =
std::min(pathStart, pathEnd);
124 if (pathStart < pathEnd) {
131 if (queryStart < queryEnd) {
133 }
else if (queryStart != std::string::npos && hashStart < queryStart) {
138 if (hashStart != std::string::npos) {
154 auto pos =
authority_.find(
":", right != std::string::npos ? right : 0);
155 if (pos != std::string::npos) {
157 port_ = folly::to<uint16_t>(
164 if (left == std::string::npos && right == std::string::npos) {
168 }
else if (left < right && right != std::string::npos) {
184 char buf4[
sizeof(in_addr)];
185 char buf6[
sizeof(in6_addr)];
189 af == AF_INET ? buf4 : buf6) == 1;
FB_EXPORT void parse() noexcept
static bool validateScheme(folly::StringPiece url)
size_type find(const_range_type str) const
constexpr size_type size() const
bool validateURL(folly::ByteRange url)
requires E e noexcept(noexcept(s.error(std::move(e))))
folly::StringPiece query_
FB_EXPORT void stripBrackets() noexcept
constexpr bool empty() const
int http_parser_parse_url(const char *buf, size_t buflen, int is_connect, struct http_parser_url *u)
constexpr Iter data() const
Range subpiece(size_type first, size_type length=npos) const
folly::StringPiece fragment_
bool parseAuthority() noexcept
const internal::AnythingMatcher _
basic_fbstring< char > fbstring
Range< const char * > StringPiece
folly::StringPiece hostNoBrackets_
struct http_parser_url::@1 field_data[UF_MAX]
void parseNonFully() noexcept
folly::StringPiece scheme_