Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Attributes | Static Private Attributes

ACE::HTTP::URL Class Reference

#include <HTTP_URL.h>

Inheritance diagram for ACE::HTTP::URL:
Inheritance graph
[legend]
Collaboration diagram for ACE::HTTP::URL:
Collaboration graph
[legend]

List of all members.

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 ()
URLoperator= (const URL &url)
virtual const ACE_CStringget_scheme () const
virtual const ACE_CStringget_query () const
virtual const ACE_CStringget_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_CStringget_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_CStringprotocol ()

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 Factoryfactory_ = *URL::TURLFactorySingleton::instance ()

Detailed Description

Definition at line 35 of file HTTP_URL.h.


Member Typedef Documentation

Reimplemented from ACE::INet::URL_Base.

Reimplemented in ACE::HTTPS::URL.

Definition at line 103 of file HTTP_URL.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
HTTP_PORT 
HTTP_PROXY_PORT 

Definition at line 74 of file HTTP_URL.h.

              {
                HTTP_PORT = 80,
                HTTP_PROXY_PORT = 8080
              };


Constructor & Destructor Documentation

ACE::HTTP::URL::URL (  ) 

Reimplemented in ACE::HTTPS::URL.

Definition at line 26 of file HTTP_URL.cpp.

ACE::HTTP::URL::URL ( const ACE_CString url_string  ) 

Reimplemented in ACE::HTTPS::URL.

Definition at line 32 of file HTTP_URL.cpp.

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]

Reimplemented in ACE::HTTPS::URL.

Definition at line 51 of file HTTP_URL.cpp.

      {
      }

ACE::HTTP::URL::URL ( u_short  port  )  [protected]

Definition at line 45 of file HTTP_URL.cpp.


Member Function Documentation

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 ();
      }

URL & ACE::HTTP::URL::operator= ( const URL url  ) 

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 ();
      }


Member Data Documentation

Reimplemented in ACE::HTTPS::URL.

Definition at line 104 of file HTTP_URL.h.

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.

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.

Definition at line 86 of file HTTP_URL.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines