Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / protocols / ace / INet / HTTPS_URL.cpp
bloba890e5405699c7dc452a2a9b3c3679c34d934455
1 #include "ace/INet/HTTPS_URL.h"
3 #if !defined (__ACE_INLINE__)
4 #include "ace/INet/HTTPS_URL.inl"
5 #endif
7 #include "ace/INet/String_IOStream.h"
8 #include "ace/INet/HTTP_ClientRequestHandler.h"
10 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
12 namespace ACE
14 namespace HTTPS
16 const char* URL::PROTOCOL = "https";
18 const ACE_CString& URL::protocol ()
20 static const ACE_CString protocol_ (PROTOCOL);
21 return protocol_;
24 URL::URL ()
25 : ACE::HTTP::URL (HTTPS_PORT)
29 URL::URL (const ACE_CString& url_string)
30 : ACE::HTTP::URL (HTTPS_PORT)
32 this->parse (url_string);
35 URL::URL (const URL& url)
36 : ACE::HTTP::URL (0)
38 *this = url;
41 URL::~URL ()
45 URL& URL::operator =(const URL& url)
47 ACE::HTTP::URL::operator=(url);
48 return *this;
51 ACE_CString URL::get_request_uri () const
53 ACE::IOS::CString_OStream sos;
54 #if 0
55 if (!this->proxy_host_.empty ())
57 sos << this->get_scheme ().c_str () << "://"
58 << ACE::INet::URL_INetBase::get_host ().c_str ();
59 if (ACE::INet::URL_INetBase::get_port () != HTTP_PORT)
61 sos << ':' << ACE::INet::URL_INetBase::get_port ();
64 #endif
65 // if path is empty we're requesting the root
66 sos << (this->get_path ().empty () ?
67 "/" :
68 this->get_path ().c_str ());
69 if (!this->get_query ().empty ())
70 sos << '?' << this->get_query ().c_str ();
71 if (!this->get_fragment ().empty ())
72 sos << '#' << this->get_fragment ().c_str ();
73 return sos.str ();
76 ACE::INet::ClientRequestHandler* URL::create_default_request_handler () const
78 ACE::INet::ClientRequestHandler* prh = 0;
79 ACE_NEW_NORETURN (prh, ACE::HTTP::ClientRequestHandler ());
80 return prh;
83 const URL::Factory& URL::factory_ = *URL::TURLFactorySingleton::instance ();
85 URL::Factory::Factory ()
87 ACE::INet::URL_Base::register_factory (this);
90 URL::Factory::~Factory ()
93 const ACE_CString& URL::Factory::protocol ()
95 return URL::protocol ();
98 ACE::INet::URL_Base* URL::Factory::create_from_string (const ACE_CString& url_string)
100 URL* purl = 0;
101 ACE_NEW_NORETURN (purl, URL (url_string));
102 return purl;
107 ACE_END_VERSIONED_NAMESPACE_DECL