1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
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"
23 #include "wx/object.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 wxObject
54 wxURL(const wxString
& url
);
57 wxString
GetProtocolName() const { return m_protoinfo
->m_protoname
; }
58 wxString
GetHostName() const { return m_hostname
; }
59 wxString
GetURL() const { return m_url
; }
60 wxProtocol
& GetProtocol() { return *m_protocol
; }
61 wxURLError
GetError() const { return m_error
; }
62 wxString
GetPath() const { return m_path
; }
64 wxInputStream
*GetInputStream();
67 static void SetDefaultProxy(const wxString
& url_proxy
);
68 void SetProxy(const wxString
& url_proxy
);
69 #endif // wxUSE_SOCKETS
71 static wxString
ConvertToValidURI(
73 const wxChar
* delims
= wxT(";/?:@&=+$,")
75 static wxString
ConvertFromURI(const wxString
& uri
);
78 static wxProtoInfo
*ms_protocols
;
81 static wxHTTP
*ms_proxyDefault
;
82 static bool ms_useDefaultProxy
;
84 #endif // wxUSE_SOCKETS
87 friend class wxURLNativeImp
;
88 // pointer to a native URL implementation object
89 wxURLNativeImp
*m_nativeImp
;
90 // Creates on the heap and returns a native
91 // implementation object for the current platform.
92 static wxURLNativeImp
*CreateNativeImpObject();
94 wxProtoInfo
*m_protoinfo
;
95 wxProtocol
*m_protocol
;
98 wxString m_protoname
, m_hostname
, m_servname
, m_path
, m_url
;
99 wxString m_user
, m_password
;
102 bool PrepProto(wxString
& url
);
103 bool PrepHost(wxString
& url
);
104 bool PrepPath(wxString
& url
);
107 bool FetchProtocol();
109 friend class wxProtoInfo
;
110 friend class wxURLModule
;
113 // VZ: can't use default copy ctor for this class, should write a correct
115 DECLARE_NO_COPY_CLASS(wxURL
)
117 DECLARE_DYNAMIC_CLASS(wxURL
)