]> git.saurik.com Git - wxWidgets.git/commitdiff
Now possible to compile with wxURL disabled
authorJulian Smart <julian@anthemion.co.uk>
Wed, 27 Oct 2004 17:33:32 +0000 (17:33 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 27 Oct 2004 17:33:32 +0000 (17:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/fs_inet.cpp
src/common/ftp.cpp
src/common/protocol.cpp
src/common/sckfile.cpp

index 7e9ce0fe0287920e70b4829f3a58a1549f1a8b4d..f2add645833392be0744aa286e97ea5c3a3a20bf 100644 (file)
@@ -84,13 +84,14 @@ static wxString StripProtocolAnchor(const wxString& location)
 
 bool wxInternetFSHandler::CanOpen(const wxString& location)
 {
+#if wxUSE_URL
     wxString p = GetProtocol(location);
     if ((p == wxT("http")) || (p == wxT("ftp")))
     {
         wxURL url(p + wxT(":") + StripProtocolAnchor(location));
         return (url.GetError() == wxURL_NOERR);
     }
-
+#endif
     return false;
 }
 
@@ -98,6 +99,9 @@ bool wxInternetFSHandler::CanOpen(const wxString& location)
 wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs),
                                         const wxString& location)
 {
+#if !wxUSE_URL
+    return NULL;
+#else
     wxString right =
         GetProtocol(location) + wxT(":") + StripProtocolAnchor(location);
 
@@ -130,6 +134,7 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs),
     }
 
     return (wxFSFile*) NULL; // incorrect URL
+#endif
 }
 
 
index 417849ea00e5c878c65bfa4bb03ac09daf7c8e16..a2f4cad4afd6efdaf7e6df71620e3f4b6b423557 100644 (file)
@@ -760,6 +760,9 @@ bool wxFTP::Abort()
 
 wxInputStream *wxFTP::GetInputStream(const wxString& path)
 {
+#if !wxUSE_URL
+    return NULL;
+#else
     if ( ( m_currentTransfermode == NONE ) && !SetTransferMode(BINARY) )
         return NULL;
 
@@ -786,6 +789,7 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path)
     wxInputFTPStream *in_stream = new wxInputFTPStream(this, sock);
 
     return in_stream;
+#endif
 }
 
 wxOutputStream *wxFTP::GetOutputStream(const wxString& path)
index 955a11de6680133b0ad8e7ccd4d46b39355ee1b1..e1933a2e200344393077fbeaef7668ff9b60c4eb 100644 (file)
@@ -45,8 +45,12 @@ wxProtoInfo::wxProtoInfo(const wxChar *name, const wxChar *serv,
 {
     m_cinfo = info;
     m_needhost = need_host1;
+#if wxUSE_URL
     next = wxURL::ms_protocols;
     wxURL::ms_protocols = this;
+#else
+    next = NULL;
+#endif
 }
 
 /////////////////////////////////////////////////////////////////
index a5c148b90c39a40f9d78ebc4d9ea1f908552b92f..2e3827ef6c809f21a7b49addc3b9c8b37a2f133b 100644 (file)
@@ -43,13 +43,17 @@ wxFileProto::~wxFileProto()
 
 wxInputStream *wxFileProto::GetInputStream(const wxString& path)
 {
-  wxFileInputStream* retval = new wxFileInputStream(wxURL::ConvertFromURI(path));
+#if !wxUSE_URL
+    return NULL;
+#else
+    wxFileInputStream* retval = new wxFileInputStream(wxURL::ConvertFromURI(path));
   if (retval->Ok()) {
     return retval;
   } else {
     delete retval;
     return 0;
   }
+#endif
 }
 
 #endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE