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 static wxString
ConvertToValidURI(
77 const wxChar
* delims
= wxT(";/?:@&=+$,")
79 static wxString
ConvertFromURI(const wxString
& uri
);
82 static wxProtoInfo
*ms_protocols
;
85 static wxHTTP
*ms_proxyDefault
;
86 static bool ms_useDefaultProxy
;
88 #endif // wxUSE_SOCKETS
91 friend class wxURLNativeImp
;
92 // pointer to a native URL implementation object
93 wxURLNativeImp
*m_nativeImp
;
94 // Creates on the heap and returns a native
95 // implementation object for the current platform.
96 static wxURLNativeImp
*CreateNativeImpObject();
98 wxProtoInfo
*m_protoinfo
;
99 wxProtocol
*m_protocol
;
105 void Init(const wxString
&);
108 bool FetchProtocol();
110 friend class wxProtoInfo
;
111 friend class wxURLModule
;
114 DECLARE_DYNAMIC_CLASS(wxURL
)