//
// --------------------------------------------------------------
+// --------------------------------------------------------------
+// Construction
+// --------------------------------------------------------------
+
wxURL::wxURL(const wxString& url) : wxURI(url)
{
Init(url);
wxURL::wxURL(const wxURI& url) : wxURI(url)
{
- Init(url.Get());
- ParseURL();
-}
-
-wxURL& wxURL::operator = (const wxURI& url)
-{
- wxURI::operator = (url);
- Init(url.Get());
- ParseURL();
- return *this;
-}
-wxURL& wxURL::operator = (const wxString& url)
-{
- wxURI::operator = (url);
- Init(url);
+ Init(url.BuildURI());
ParseURL();
- return *this;
}
void wxURL::Init(const wxString& url)
#endif // wxUSE_SOCKETS
}
+
+// --------------------------------------------------------------
+// Assignment
+// --------------------------------------------------------------
+
+wxURL& wxURL::operator = (const wxURI& url)
+{
+ wxURI::operator = (url);
+ Init(url.BuildURI());
+ ParseURL();
+ return *this;
+}
+wxURL& wxURL::operator = (const wxString& url)
+{
+ wxURI::operator = (url);
+ Init(url);
+ ParseURL();
+ return *this;
+}
+
// --------------------------------------------------------------
// ParseURL
//
return true;
}
+// --------------------------------------------------------------
+// Destruction/Cleanup
+// --------------------------------------------------------------
+
void wxURL::CleanData()
{
#if wxUSE_SOCKETS
#endif
}
+// --------------------------------------------------------------
+// FetchProtocol
+// --------------------------------------------------------------
bool wxURL::FetchProtocol()
{
}
// --------------------------------------------------------------
-// --------- wxURL get ------------------------------------------
+// GetInputStream
// --------------------------------------------------------------
wxInputStream *wxURL::GetInputStream()
#endif
// When we use a proxy, we have to pass the whole URL to it.
- wxInputStream *the_i_stream =
- (m_useProxy) ? m_protocol->GetInputStream(m_url) :
- m_protocol->GetInputStream(m_path);
+ wxInputStream *the_i_stream;
+
+ if (!m_useProxy)
+ {
+ the_i_stream = m_protocol->GetInputStream(m_url);
+ }
+ else
+ {
+ wxString fullPath = m_path;
+
+ if (HasQuery())
+ fullPath += wxT("?") + m_query;
+
+ if (HasFragment())
+ fullPath += wxT("#") + m_fragment;
+
+ the_i_stream = m_protocol->GetInputStream(fullPath);
+ }
if (!the_i_stream)
{
#endif // wxUSE_SOCKETS
// ----------------------------------------------------------------------
+// wxURLModule
+//
// A module which deletes the default proxy if we created it
// ----------------------------------------------------------------------