Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / protocols / ace / INet / HTTP_URL.h
blob8971006fccda4e53acdc4e66c3dcf5102a625840
1 /**
2 * @file HTTP_URL.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_HTTP_URL_H
8 #define ACE_HTTP_URL_H
10 #include /**/ "ace/pre.h"
12 #include /**/ "ace/config-all.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
15 # pragma once
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "ace/INet/INet_Export.h"
19 #include "ace/INet/URLBase.h"
21 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
23 namespace ACE
25 namespace HTTP
27 /**
28 * @class ACE_HTTP_URL
30 * @brief Implements HTTP url support.
33 class ACE_INET_Export URL
34 : public ACE::INet::URL_INetAuthBase
36 public:
37 URL ();
38 URL (const ACE_CString& url_string);
39 URL (const URL& url);
40 virtual ~URL ();
42 URL& operator =(const URL& url);
44 virtual const ACE_CString& get_scheme () const;
46 virtual const ACE_CString& get_query () const;
48 virtual const ACE_CString& get_fragment () const;
50 virtual ACE_CString get_request_uri () const;
52 virtual void set_query (const ACE_CString& query);
54 virtual void set_fragment (const ACE_CString& fargment);
56 void set_proxy (const ACE_CString& proxy_host, u_short proxy_port = HTTP_PROXY_PORT);
58 const ACE_CString& get_proxy_host () const;
60 u_short get_proxy_port () const;
62 bool has_proxy () const;
64 virtual ACE_CString to_string () const;
66 virtual u_short default_port () const;
68 static const char* PROTOCOL;
70 static const ACE_CString& protocol ();
72 enum
74 HTTP_PORT = 80,
75 HTTP_PROXY_PORT = 8080
78 protected:
79 URL (u_short port);
81 virtual ACE::INet::ClientRequestHandler* create_default_request_handler () const;
83 private:
84 ACE_CString query_;
85 ACE_CString fragment_;
86 ACE_CString proxy_host_;
87 u_short proxy_port_;
89 private:
90 class Factory
91 : public ACE::INet::URL_Base::Factory
93 public:
94 Factory ();
95 virtual ~Factory ();
96 virtual const ACE_CString& protocol ();
97 virtual ACE::INet::URL_Base* create_from_string (const ACE_CString& url_string);
100 typedef ACE_Singleton<Factory,
101 ACE_Null_Mutex> TURLFactorySingleton;
102 static const Factory& factory_;
107 ACE_END_VERSIONED_NAMESPACE_DECL
109 #if defined (__ACE_INLINE__)
110 #include "ace/INet/HTTP_URL.inl"
111 #endif
113 #include /**/ "ace/post.h"
114 #endif /* ACE_HTTP_URL_H */