1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
5 // Modified by: Ryan Norton
8 // Copyright: (c) 1997, 1998 Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "url.h"
24 #include "wx/protocol/protocol.h"
26 #if wxUSE_PROTOCOL_HTTP
27 #include "wx/protocol/http.h"
41 class WXDLLIMPEXP_NET wxURL
;
43 class WXDLLIMPEXP_NET wxURLNativeImp
: public wxObject
46 virtual ~wxURLNativeImp() { }
47 virtual wxInputStream
*GetInputStream(wxURL
*owner
) = 0;
49 #endif // wxUSE_URL_NATIVE
51 class WXDLLIMPEXP_NET wxURL
: public wxURI
54 wxURL(const wxString
& sUrl
);
55 wxURL(const wxURI
& url
);
58 wxURL
& operator = (const wxString
& url
);
59 wxURL
& operator = (const wxURI
& url
);
61 wxString
GetProtocolName() const { return m_scheme
; }
62 wxString
GetHostName() const { return m_server
; }
63 wxString
GetURL() const { return m_url
; }
64 wxProtocol
& GetProtocol() { return *m_protocol
; }
65 wxURLError
GetError() const { return m_error
; }
66 wxString
GetPath() const { return m_path
; }
68 wxInputStream
*GetInputStream();
71 static void SetDefaultProxy(const wxString
& url_proxy
);
72 void SetProxy(const wxString
& url_proxy
);
73 #endif // wxUSE_SOCKETS
75 #if WXWIN_COMPATIBILITY_2_4
76 //Use wxURI instead - delims is ignored
77 static wxString
ConvertToValidURI(
79 const wxChar
* delims
= wxT(";/?:@&=+$,")
82 //Use wxURI::Unescape instead
83 static wxString
ConvertFromURI(const wxString
& uri
);
87 static wxProtoInfo
*ms_protocols
;
90 static wxHTTP
*ms_proxyDefault
;
91 static bool ms_useDefaultProxy
;
93 #endif // wxUSE_SOCKETS
96 friend class wxURLNativeImp
;
97 // pointer to a native URL implementation object
98 wxURLNativeImp
*m_nativeImp
;
99 // Creates on the heap and returns a native
100 // implementation object for the current platform.
101 static wxURLNativeImp
*CreateNativeImpObject();
103 wxProtoInfo
*m_protoinfo
;
104 wxProtocol
*m_protocol
;
110 void Init(const wxString
&);
113 bool FetchProtocol();
115 friend class wxProtoInfo
;
116 friend class wxURLModule
;
119 DECLARE_DYNAMIC_CLASS(wxURL
)