43 RemoveProtocol = 1 << 0,
44 RemovePassword = 1 << 1,
45 RemoveUserInfo = RemovePassword | 1 << 2,
53 Protocol force_protocol = PROT_UNKNOWN);
80 Protocol force_protocol = PROT_UNKNOWN);
85 bool isUsable()
const {
return !myHost.isEmpty(); }
87 explicit operator bool()
const {
return isUsable(); }
98 str.
format(
"{}:{}", myHost, port());
103 bool usingDefaultPortForProtocol()
const;
104 static bool isDefaultPortForProtocol(Protocol prot,
int port);
106 inline bool hasMatchingPath(
const UT_Url &url)
const;
110 bool hasMatchingHost(
const UT_Url &url)
const;
154 return myProtocol == url.myProtocol && myUser == url.myUser &&
157 myQueryString == url.myQueryString;
163 return !(*
this == url);
179 path_view = path_view.
trim(
"/");
180 other_path_view = other_path_view.
trim(
"/");
182 return path_view == other_path_view;
195 #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
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
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