38 RemoveProtocol = 1 << 0,
39 RemovePassword = 1 << 1,
40 RemoveUserInfo = RemovePassword | 1 << 2,
48 Protocol force_protocol = PROT_UNKNOWN);
69 Protocol force_protocol = PROT_UNKNOWN);
74 bool isUsable()
const {
return !myHost.isEmpty(); }
76 explicit operator bool()
const {
return isUsable(); }
87 str.
format(
"{}:{}", myHost, port());
92 bool usingDefaultPortForProtocol()
const;
93 static bool isDefaultPortForProtocol(Protocol prot,
int port);
95 inline bool hasMatchingPath(
const UT_Url &url)
const;
99 bool hasMatchingHost(
const UT_Url &url)
const;
143 return myProtocol == url.myProtocol && myUser == url.myUser &&
146 myQueryString == url.myQueryString;
152 return !(*
this == url);
168 path_view = path_view.
trim(
"/");
169 other_path_view = other_path_view.
trim(
"/");
171 return path_view == other_path_view;
174 #endif // __UT_URL_H__
bool hasMatchingPath(const UT_Url &url) const
void setQueryString(const UT_StringHolder &query)
void setProtocol(Protocol protocol)
SYS_FORCE_INLINE const_iterator begin() const
bool operator!=(const UT_Url &url) const
const UT_StringHolder & path() const
bool hasMatchingHost(const UT_Url &url) const
const UT_StringHolder & password() const
GLsizei const GLchar *const * path
const UT_StringHolder & user() const
SYS_FORCE_INLINE const_iterator end() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
A utility class to do read-only operations on a subset of an existing string.
void setPath(const UT_StringHolder &path)
GLint GLint GLsizei GLint GLenum format
Protocol protocol() const
void setHost(const UT_StringHolder &host)
size_t format(const char *fmt, const Args &...args)
Format a string using the same formatting codes as UTformat.
UT_StringHolder toHostPort() const
bool operator==(const UT_Url &url) const
static const UT_Url theInvalidUrl
const UT_StringHolder & host() const
LeafData & operator=(const LeafData &)=delete
const UT_StringHolder & queryString() const
void setPassword(const UT_StringHolder &pass)
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setUser(const UT_StringHolder &user)
SYS_NO_DISCARD_RESULT SYS_FORCE_INLINE UT_StringView trim(const char *c=" \t\n\r") const