43 if (parseUrl.
port()) {
57 std::ostringstream out;
58 out << scheme <<
"://" << hostAndPort <<
'/' << path;
62 if (!fragment.empty()) {
63 out <<
'#' << fragment;
87 valid_ = (scheme ==
"http" || scheme ==
"https");
139 return folly::to<std::string>(
141 query_.empty() ?
"" : folly::to<std::string>(
'?',
query_),
157 return !(lhs ==
rhs);
URL(const std::string &url="") noexcept
const std::string & getHost() const noexcept
folly::StringPiece query() const
std::string makeRelativeURL() const noexcept
folly::StringPiece url() const
bool isValid() const noexcept
folly::StringPiece hostNoBrackets()
const std::string & getUrl() const noexcept
requires E e noexcept(noexcept(s.error(std::move(e))))
PUSHMI_INLINE_VAR constexpr detail::transform_fn transform
std::string getHostAndPort() const noexcept
FOLLY_PUSH_WARNING RHS rhs
const std::string & getPath() const noexcept
folly::StringPiece path() const
bool hasHost() const noexcept
friend bool operator!=(const URL &lhs, const URL &rhs)
URL(const std::string scheme, const std::string host, uint16_t port=0, const std::string path="", const std::string query="", const std::string fragment="") noexcept
const std::string & getQuery() const noexcept
bool isSecure() const noexcept
friend bool operator==(const URL &lhs, const URL &rhs)
const std::string & getScheme() const noexcept
static std::string createUrl(const std::string &scheme, const std::string &hostAndPort, const std::string &path, const std::string &query, const std::string &fragment) noexcept
uint16_t getPort() const noexcept
folly::StringPiece scheme() const
const std::string & getFragment() const noexcept
folly::StringPiece fragment() const