#include <HTTP_URL.h>


Classes | |
| class | Factory |
Public Types | |
| enum | { HTTP_PORT = 80, HTTP_PROXY_PORT = 8080 } |
Public Member Functions | |
| URL () | |
| URL (const ACE_CString &url_string) | |
| URL (const URL &url) | |
| virtual | ~URL () |
| URL & | operator= (const URL &url) |
| virtual const ACE_CString & | get_scheme () const |
| virtual const ACE_CString & | get_query () const |
| virtual const ACE_CString & | get_fragment () const |
| virtual ACE_CString | get_request_uri () const |
| virtual void | set_query (const ACE_CString &query) |
| virtual void | set_fragment (const ACE_CString &fargment) |
| void | set_proxy (const ACE_CString &proxy_host, u_short proxy_port=HTTP_PROXY_PORT) |
| const ACE_CString & | get_proxy_host () const |
| u_short | get_proxy_port () const |
| bool | has_proxy () const |
| virtual ACE_CString | to_string () const |
| virtual u_short | default_port () const |
Static Public Member Functions | |
| static const ACE_CString & | protocol () |
Static Public Attributes | |
| static const char * | PROTOCOL = "http" |
Protected Member Functions | |
| URL (u_short port) | |
| virtual ACE::INet::ClientRequestHandler * | create_default_request_handler () const |
Private Types | |
| typedef ACE_Singleton< Factory, ACE_Null_Mutex > | TURLFactorySingleton |
Private Attributes | |
| ACE_CString | query_ |
| ACE_CString | fragment_ |
| ACE_CString | proxy_host_ |
| u_short | proxy_port_ |
Static Private Attributes | |
| static const Factory & | factory_ = *URL::TURLFactorySingleton::instance () |
Definition at line 35 of file HTTP_URL.h.
typedef ACE_Singleton<Factory, ACE_Null_Mutex> ACE::HTTP::URL::TURLFactorySingleton [private] |
Reimplemented from ACE::INet::URL_Base.
Reimplemented in ACE::HTTPS::URL.
Definition at line 103 of file HTTP_URL.h.
| anonymous enum |
Definition at line 74 of file HTTP_URL.h.
{
HTTP_PORT = 80,
HTTP_PROXY_PORT = 8080
};
| ACE::HTTP::URL::URL | ( | ) |
Reimplemented in ACE::HTTPS::URL.
Definition at line 26 of file HTTP_URL.cpp.
: URL_INetAuthBase (HTTP_PORT), proxy_port_ (HTTP_PROXY_PORT) { }
| ACE::HTTP::URL::URL | ( | const ACE_CString & | url_string | ) |
Reimplemented in ACE::HTTPS::URL.
Definition at line 32 of file HTTP_URL.cpp.
: URL_INetAuthBase (HTTP_PORT), proxy_port_ (HTTP_PROXY_PORT) { this->parse (url_string); }
| ACE::HTTP::URL::URL | ( | const URL & | url | ) |
Definition at line 39 of file HTTP_URL.cpp.
: URL_INetAuthBase (0) { *this = url; }
| ACE::HTTP::URL::~URL | ( | ) | [virtual] |
| ACE::HTTP::URL::URL | ( | u_short | port | ) | [protected] |
Definition at line 45 of file HTTP_URL.cpp.
: URL_INetAuthBase (port), proxy_port_ (HTTP_PROXY_PORT) { }
| ACE::INet::ClientRequestHandler * ACE::HTTP::URL::create_default_request_handler | ( | ) | const [protected, virtual] |
Implements ACE::INet::URL_Base.
Reimplemented in ACE::HTTPS::URL.
Definition at line 103 of file HTTP_URL.cpp.
{
ACE::INet::ClientRequestHandler* prh = 0;
ACE_NEW_NORETURN (prh, ClientRequestHandler ());
return prh;
}
| u_short ACE::HTTP::URL::default_port | ( | ) | const [inline, virtual] |
Implements ACE::INet::URL_INetBase.
Reimplemented in ACE::HTTPS::URL.
Definition at line 68 of file HTTP_URL.inl.
{
return HTTP_PORT;
}
| const ACE_CString & ACE::HTTP::URL::get_fragment | ( | ) | const [inline, virtual] |
Reimplemented from ACE::INet::URL_Base.
Definition at line 25 of file HTTP_URL.inl.
{
return this->fragment_;
}
| const ACE_CString & ACE::HTTP::URL::get_proxy_host | ( | ) | const [inline] |
Definition at line 50 of file HTTP_URL.inl.
{
return this->proxy_host_;
}
| u_short ACE::HTTP::URL::get_proxy_port | ( | ) | const [inline] |
Definition at line 56 of file HTTP_URL.inl.
{
return this->proxy_port_;
}
| const ACE_CString & ACE::HTTP::URL::get_query | ( | ) | const [inline, virtual] |
Reimplemented from ACE::INet::URL_Base.
Definition at line 19 of file HTTP_URL.inl.
{
return this->query_;
}
| ACE_CString ACE::HTTP::URL::get_request_uri | ( | ) | const [virtual] |
Reimplemented in ACE::HTTPS::URL.
Definition at line 67 of file HTTP_URL.cpp.
{
ACE::IOS::CString_OStream sos;
if (!this->proxy_host_.empty ())
{
sos << this->get_scheme ().c_str () << "://"
<< ACE::INet::URL_INetBase::get_host ().c_str ();
if (ACE::INet::URL_INetBase::get_port () != HTTP_PORT)
{
sos << ':' << ACE::INet::URL_INetBase::get_port ();
}
}
// if path is empty we're requesting the root
sos << (this->get_path ().empty () ?
"/" :
this->get_path ().c_str ());
if (!this->get_query ().empty ())
sos << '?' << this->get_query ().c_str ();
if (!this->get_fragment ().empty ())
sos << '#' << this->get_fragment ().c_str ();
return sos.str ();
}
| const ACE_CString & ACE::HTTP::URL::get_scheme | ( | ) | const [inline, virtual] |
Implements ACE::INet::URL_Base.
Reimplemented in ACE::HTTPS::URL.
Definition at line 13 of file HTTP_URL.inl.
{
return protocol ();
}
| bool ACE::HTTP::URL::has_proxy | ( | ) | const [inline] |
Definition at line 62 of file HTTP_URL.inl.
{
return !this->proxy_host_.empty ();
}
Definition at line 55 of file HTTP_URL.cpp.
{
this->set_user_info (url.get_user_info ());
this->set_host (url.get_host ());
this->set_port (url.get_port ());
this->set_path (url.get_path ());
this->set_query (url.get_query ());
this->set_fragment (url.get_fragment ());
this->set_proxy (url.get_proxy_host (), url.get_proxy_port ());
return *this;
}
| const ACE_CString & ACE::HTTP::URL::protocol | ( | ) | [static] |
Reimplemented in ACE::HTTPS::URL.
Definition at line 20 of file HTTP_URL.cpp.
{
static const ACE_CString protocol_ (PROTOCOL);
return protocol_;
}
| void ACE::HTTP::URL::set_fragment | ( | const ACE_CString & | fargment | ) | [inline, virtual] |
Definition at line 37 of file HTTP_URL.inl.
{
this->fragment_ = fragment;
}
| void ACE::HTTP::URL::set_proxy | ( | const ACE_CString & | proxy_host, | |
| u_short | proxy_port = HTTP_PROXY_PORT | |||
| ) | [inline] |
Definition at line 43 of file HTTP_URL.inl.
{
this->proxy_host_ = proxy_host;
this->proxy_port_ = proxy_port;
}
| void ACE::HTTP::URL::set_query | ( | const ACE_CString & | query | ) | [inline, virtual] |
Definition at line 31 of file HTTP_URL.inl.
{
this->query_ = query;
}
| ACE_CString ACE::HTTP::URL::to_string | ( | void | ) | const [virtual] |
Implements ACE::INet::URL_Base.
Definition at line 90 of file HTTP_URL.cpp.
{
ACE::IOS::CString_OStream sos;
sos << this->get_scheme () << "://"
<< this->get_authority ().c_str ()
<< this->get_path ().c_str ();
if (!this->get_query ().empty ())
sos << '?' << this->get_query ().c_str ();
if (!this->get_fragment ().empty ())
sos << '#' << this->get_fragment ().c_str ();
return sos.str ();
}
const URL::Factory & ACE::HTTP::URL::factory_ = *URL::TURLFactorySingleton::instance () [static, private] |
Reimplemented in ACE::HTTPS::URL.
Definition at line 104 of file HTTP_URL.h.
ACE_CString ACE::HTTP::URL::fragment_ [private] |
Definition at line 87 of file HTTP_URL.h.
const char * ACE::HTTP::URL::PROTOCOL = "http" [static] |
Reimplemented in ACE::HTTPS::URL.
Definition at line 70 of file HTTP_URL.h.
ACE_CString ACE::HTTP::URL::proxy_host_ [private] |
Definition at line 88 of file HTTP_URL.h.
u_short ACE::HTTP::URL::proxy_port_ [private] |
Definition at line 89 of file HTTP_URL.h.
ACE_CString ACE::HTTP::URL::query_ [private] |
Definition at line 86 of file HTTP_URL.h.
1.7.0