#include <URLBase.h>
Public Member Functions | |
URL_INetBase (u_short port) | |
virtual | ~URL_INetBase () |
void | set_host (const ACE_CString &host) |
void | set_port (u_short port) |
const ACE_CString & | get_host () const |
u_short | get_port () const |
virtual u_short | default_port () const =0 |
virtual ACE_CString | get_authority () const |
virtual bool | validate () |
Protected Member Functions | |
virtual int | parse_authority (std::istream &is) |
virtual bool | has_authority () |
int | parse_authority_i (std::istream &is, std::ostream &os, int lastch) |
Private Attributes | |
ACE_CString | host_ |
u_short | port_ |
Definition at line 147 of file URLBase.h.
ACE::INet::URL_INetBase::URL_INetBase | ( | u_short | port | ) |
Definition at line 243 of file URLBase.cpp.
ACE::INet::URL_INetBase::~URL_INetBase | ( | ) | [virtual] |
Definition at line 248 of file URLBase.cpp.
{}
virtual u_short ACE::INet::URL_INetBase::default_port | ( | ) | const [pure virtual] |
Implemented in ACE::FTP::URL, ACE::HTTP::URL, and ACE::HTTPS::URL.
ACE_CString ACE::INet::URL_INetBase::get_authority | ( | ) | const [virtual] |
Reimplemented from ACE::INet::URL_Base.
Reimplemented in ACE::INet::URL_INetAuthBase.
Definition at line 335 of file URLBase.cpp.
{ ACE::IOS::CString_OStream sos; sos << this->get_host().c_str (); if (this->get_port () != this->default_port ()) sos << ':' << this->get_port (); return sos.str (); }
const ACE_CString & ACE::INet::URL_INetBase::get_host | ( | ) | const [inline] |
Definition at line 58 of file URLBase.inl.
{ return this->host_; }
u_short ACE::INet::URL_INetBase::get_port | ( | ) | const [inline] |
Definition at line 64 of file URLBase.inl.
{ return this->port_; }
bool ACE::INet::URL_INetBase::has_authority | ( | ) | [protected, virtual] |
Reimplemented from ACE::INet::URL_Base.
Definition at line 325 of file URLBase.cpp.
{ return true; }
int ACE::INet::URL_INetBase::parse_authority | ( | std::istream & | is | ) | [protected, virtual] |
Reimplemented from ACE::INet::URL_Base.
Reimplemented in ACE::INet::URL_INetAuthBase.
Definition at line 250 of file URLBase.cpp.
{ ACE::IOS::CString_OStream sos; return this->parse_authority_i (is, sos, 0); }
int ACE::INet::URL_INetBase::parse_authority_i | ( | std::istream & | is, | |
std::ostream & | os, | |||
int | lastch | |||
) | [protected] |
Definition at line 256 of file URLBase.cpp.
{ static const int eof = std::char_traits<ACE::IOS::CString_OStream::char_type>::eof (); ACE::IOS::CString_OStream& sos = dynamic_cast<ACE::IOS::CString_OStream&> (os); int ch = lastch; if (ch == 0) { // parse host part for (ch = is.get (); #if defined (ACE_HAS_IPV6) ch != '[' && ch != '/' && ch != ':' && ch != '@' && ch != '?' && ch != '#' && ch != eof ; #else ch != '/' && ch != ':' && ch != '@' && ch != '?' && ch != '#' && ch != eof ; #endif ch = is.get ()) sos.put (ch); } #if defined (ACE_HAS_IPV6) if (ch == '[') { sos.clear (); for (ch = is.get (); ch != ']' && ch != eof ;ch = is.get ()) sos.put (ch); if (ch != eof) ch = is.get (); // skip ']' if (ch != '/' && ch != ':' && ch != '?' && ch != '#' && ch != eof) { this->set_host (empty_); // invalid URL, clear host field ch = eof; // stop parsing } else { this->set_host (sos.str ()); } } else { #endif this->set_host (sos.str ()); #if defined (ACE_HAS_IPV6) } #endif sos.clear (); if (ch == ':') { u_short port = 0; is >> port; // should stop at '/' or '?' or '#' or eof ch = is.get (); if (ch == '/' || ch == '?' || ch == '#' || ch == eof) this->set_port (port); else this->set_port (0); } else { this->set_port (this->default_port ()); } return ch; }
void ACE::INet::URL_INetBase::set_host | ( | const ACE_CString & | host | ) | [inline] |
Definition at line 70 of file URLBase.inl.
{ this->host_ = host; }
void ACE::INet::URL_INetBase::set_port | ( | u_short | port | ) | [inline] |
Definition at line 76 of file URLBase.inl.
{ this->port_ = port; }
bool ACE::INet::URL_INetBase::validate | ( | ) | [virtual] |
Reimplemented from ACE::INet::URL_Base.
Definition at line 330 of file URLBase.cpp.
ACE_CString ACE::INet::URL_INetBase::host_ [private] |
u_short ACE::INet::URL_INetBase::port_ [private] |