- // Do we need a host name ?
- if (m_protoinfo->m_needhost) {
- // Extract it
- if (!PrepHost(last_url)) {
- m_error = wxURL_SNTXERR;
- return FALSE;
+}
+
+// --------------------------------------------------------------
+// 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
+//
+// Builds the URL and takes care of the old protocol stuff
+// --------------------------------------------------------------
+
+bool wxURL::ParseURL()
+{
+ // If the URL was already parsed (m_protocol != NULL), pass this section.
+ if (!m_protocol)
+ {
+ // Clean up
+ CleanData();
+
+ // Make sure we have a protocol/scheme
+ if (!HasScheme())
+ {
+ m_error = wxURL_SNTXERR;
+ return false;
+ }
+
+ // Find and create the protocol object
+ if (!FetchProtocol())
+ {
+ m_error = wxURL_NOPROTO;
+ return false;
+ }
+
+ // Do we need a host name ?
+ if (m_protoinfo->m_needhost)
+ {
+ // Make sure we have one, then
+ if (!HasServer())
+ {
+ m_error = wxURL_SNTXERR;
+ return false;
+ }
+ }