HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Url Class Reference

#include <UT_Url.h>

Public Types

enum  Protocol {
  PROT_UNKNOWN, PROT_HTTP, PROT_HTTPS, PROT_WS,
  PROT_WSS, PROT_SMTP
}
 
enum  FormattingOptions : unsigned {
  None = 0x0, RemoveProtocol = 1 << 0, RemovePassword = 1 << 1, RemoveUserInfo = RemovePassword | 1 << 2,
  RemovePort = 1 << 3, RemovePath = 1 << 4, RemoveQuery = 1 << 5
}
 

Public Member Functions

 UT_Url ()
 
 UT_Url (const UT_StringRef &url_string, Protocol force_protocol=PROT_UNKNOWN)
 
 UT_Url (Protocol prot, const UT_StringHolder &host, int port, const UT_StringHolder &path)
 
 UT_Url (Protocol prot, const UT_StringHolder &user, const UT_StringHolder &password, const UT_StringHolder &host, int port, const UT_StringHolder &path, const UT_StringHolder &query_string)
 
 UT_Url (const UT_Url &url)=default
 
UT_Urloperator= (const UT_Url &url)=default
 
 UT_Url (UT_Url &&url)=default
 
UT_Urloperator= (UT_Url &&url)=default
 
bool parse (const UT_StringRef &str_url, Protocol force_protocol=PROT_UNKNOWN)
 
void clear ()
 
bool isUsable () const
 
 operator bool () const
 
bool operator== (const UT_Url &url) const
 
bool operator!= (const UT_Url &url) const
 
UT_StringHolder toString (unsigned format=FormattingOptions::None) const
 
UT_StringHolder toHostPort () const
 
UT_StringHolder protocolToString () const
 
bool usingDefaultPortForProtocol () const
 
bool hasMatchingPath (const UT_Url &url) const
 
bool hasMatchingPath (const UT_StringHolder &path) const
 
bool hasMatchingHost (const UT_Url &url) const
 
bool hasMatchingHost (const UT_StringHolder &host) const
 
Protocol protocol () const
 
void setProtocol (Protocol protocol)
 
const UT_StringHolderuser () const
 
void setUser (const UT_StringHolder &user)
 
const UT_StringHolderpassword () const
 
void setPassword (const UT_StringHolder &pass)
 
const UT_StringHolderhost () const
 
void setHost (const UT_StringHolder &host)
 
int port () const
 
int rawPort () const
 
void setPort (int port)
 
const UT_StringHolderpath () const
 
void setPath (const UT_StringHolder &path)
 
const UT_StringHolderqueryString () const
 
void setQueryString (const UT_StringHolder &query)
 

Static Public Member Functions

static bool isDefaultPortForProtocol (Protocol prot, int port)
 

Static Public Attributes

static const UT_Url theInvalidUrl
 

Detailed Description

Definition at line 22 of file UT_Url.h.

Member Enumeration Documentation

enum UT_Url::FormattingOptions : unsigned
Enumerator
None 
RemoveProtocol 
RemovePassword 
RemoveUserInfo 
RemovePort 
RemovePath 
RemoveQuery 

Definition at line 35 of file UT_Url.h.

Enumerator
PROT_UNKNOWN 
PROT_HTTP 
PROT_HTTPS 
PROT_WS 
PROT_WSS 
PROT_SMTP 

Definition at line 25 of file UT_Url.h.

Constructor & Destructor Documentation

UT_Url::UT_Url ( )
UT_Url::UT_Url ( const UT_StringRef url_string,
Protocol  force_protocol = PROT_UNKNOWN 
)
UT_Url::UT_Url ( Protocol  prot,
const UT_StringHolder host,
int  port,
const UT_StringHolder path 
)
UT_Url::UT_Url ( Protocol  prot,
const UT_StringHolder user,
const UT_StringHolder password,
const UT_StringHolder host,
int  port,
const UT_StringHolder path,
const UT_StringHolder query_string 
)
UT_Url::UT_Url ( const UT_Url url)
default
UT_Url::UT_Url ( UT_Url &&  url)
default

Member Function Documentation

void UT_Url::clear ( )
bool UT_Url::hasMatchingHost ( const UT_Url url) const
bool UT_Url::hasMatchingHost ( const UT_StringHolder host) const
bool UT_Url::hasMatchingPath ( const UT_Url url) const
inline

Definition at line 156 of file UT_Url.h.

bool UT_Url::hasMatchingPath ( const UT_StringHolder path) const
inline

Definition at line 162 of file UT_Url.h.

const UT_StringHolder& UT_Url::host ( ) const
inline

Definition at line 112 of file UT_Url.h.

static bool UT_Url::isDefaultPortForProtocol ( Protocol  prot,
int  port 
)
static
bool UT_Url::isUsable ( ) const
inline

Definition at line 74 of file UT_Url.h.

UT_Url::operator bool ( ) const
inlineexplicit

Definition at line 76 of file UT_Url.h.

bool UT_Url::operator!= ( const UT_Url url) const
inline

Definition at line 150 of file UT_Url.h.

UT_Url& UT_Url::operator= ( const UT_Url url)
default
UT_Url& UT_Url::operator= ( UT_Url &&  url)
default
bool UT_Url::operator== ( const UT_Url url) const
inline

Definition at line 141 of file UT_Url.h.

bool UT_Url::parse ( const UT_StringRef str_url,
Protocol  force_protocol = PROT_UNKNOWN 
)
const UT_StringHolder& UT_Url::password ( ) const
inline

Definition at line 109 of file UT_Url.h.

const UT_StringHolder& UT_Url::path ( ) const
inline

Definition at line 120 of file UT_Url.h.

int UT_Url::port ( ) const
Protocol UT_Url::protocol ( ) const
inline

Definition at line 103 of file UT_Url.h.

UT_StringHolder UT_Url::protocolToString ( ) const
const UT_StringHolder& UT_Url::queryString ( ) const
inline

Definition at line 123 of file UT_Url.h.

int UT_Url::rawPort ( ) const
inline

Definition at line 117 of file UT_Url.h.

void UT_Url::setHost ( const UT_StringHolder host)
inline

Definition at line 113 of file UT_Url.h.

void UT_Url::setPassword ( const UT_StringHolder pass)
inline

Definition at line 110 of file UT_Url.h.

void UT_Url::setPath ( const UT_StringHolder path)
inline

Definition at line 121 of file UT_Url.h.

void UT_Url::setPort ( int  port)
inline

Definition at line 118 of file UT_Url.h.

void UT_Url::setProtocol ( Protocol  protocol)
inline

Definition at line 104 of file UT_Url.h.

void UT_Url::setQueryString ( const UT_StringHolder query)
inline

Definition at line 124 of file UT_Url.h.

void UT_Url::setUser ( const UT_StringHolder user)
inline

Definition at line 107 of file UT_Url.h.

UT_StringHolder UT_Url::toHostPort ( ) const
inline

Definition at line 84 of file UT_Url.h.

UT_StringHolder UT_Url::toString ( unsigned  format = FormattingOptions::None) const
const UT_StringHolder& UT_Url::user ( ) const
inline

Definition at line 106 of file UT_Url.h.

bool UT_Url::usingDefaultPortForProtocol ( ) const

Member Data Documentation

const UT_Url UT_Url::theInvalidUrl
static

Definition at line 128 of file UT_Url.h.


The documentation for this class was generated from the following file: