From: Julian Smart Date: Wed, 27 Oct 2004 17:33:32 +0000 (+0000) Subject: Now possible to compile with wxURL disabled X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/34e0d9f874fe4ba3dd8112a68831cb20bb80cac7 Now possible to compile with wxURL disabled git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/fs_inet.cpp b/src/common/fs_inet.cpp index 7e9ce0fe02..f2add64583 100644 --- a/src/common/fs_inet.cpp +++ b/src/common/fs_inet.cpp @@ -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 } diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 417849ea00..a2f4cad4af 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -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) diff --git a/src/common/protocol.cpp b/src/common/protocol.cpp index 955a11de66..e1933a2e20 100644 --- a/src/common/protocol.cpp +++ b/src/common/protocol.cpp @@ -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 } ///////////////////////////////////////////////////////////////// diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp index a5c148b90c..2e3827ef6c 100644 --- a/src/common/sckfile.cpp +++ b/src/common/sckfile.cpp @@ -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