44 RemoveProtocol = 1 << 0,
45 RemovePassword = 1 << 1,
46 RemoveUserInfo = RemovePassword | 1 << 2,
54 Protocol force_protocol = PROT_UNKNOWN);
81 Protocol force_protocol = PROT_UNKNOWN);
86 bool isUsable()
const {
return !myHost.isEmpty(); }
88 explicit operator bool()
const {
return isUsable(); }
102 str.
format(
"{}:{}", myHost, port());
107 bool usingDefaultPortForProtocol()
const;
108 static bool isDefaultPortForProtocol(Protocol prot,
int port);
110 inline bool hasMatchingPath(
const UT_Url &url)
const;
114 bool hasMatchingHost(
const UT_Url &url)
const;
162 return myProtocol == url.myProtocol && myUser == url.myUser
165 && myQueryString == url.myQueryString
166 && myFragment == url.myFragment;
172 return !(*
this == url);
188 path_view = path_view.
trim(
"/");
189 other_path_view = other_path_view.
trim(
"/");
191 return path_view == other_path_view;
204 #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
UT_API bool UTsqlBind(UT_SqlStatement &stmt, int idx, const UT_Url &url)
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
void setFragment(const UT_StringHolder &frag)
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)
UT_ORMColumnType UTsqlOrmColumnType< UT_Url >()
GLint GLint GLsizei GLint GLenum format
Protocol protocol() const
const UT_StringHolder & fragment() 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_API bool UTsqlGet(const UT_SqlStatement &stmt, int idx, UT_Url &url)
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
UT_Url & operator=(const UT_StringRef &url_str)
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