Now possible to compile with wxURL disabled
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -84,13 +84,14 @@ static wxString StripProtocolAnchor(const wxString& location)
|
|||||||
|
|
||||||
bool wxInternetFSHandler::CanOpen(const wxString& location)
|
bool wxInternetFSHandler::CanOpen(const wxString& location)
|
||||||
{
|
{
|
||||||
|
#if wxUSE_URL
|
||||||
wxString p = GetProtocol(location);
|
wxString p = GetProtocol(location);
|
||||||
if ((p == wxT("http")) || (p == wxT("ftp")))
|
if ((p == wxT("http")) || (p == wxT("ftp")))
|
||||||
{
|
{
|
||||||
wxURL url(p + wxT(":") + StripProtocolAnchor(location));
|
wxURL url(p + wxT(":") + StripProtocolAnchor(location));
|
||||||
return (url.GetError() == wxURL_NOERR);
|
return (url.GetError() == wxURL_NOERR);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,6 +99,9 @@ bool wxInternetFSHandler::CanOpen(const wxString& location)
|
|||||||
wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs),
|
wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs),
|
||||||
const wxString& location)
|
const wxString& location)
|
||||||
{
|
{
|
||||||
|
#if !wxUSE_URL
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
wxString right =
|
wxString right =
|
||||||
GetProtocol(location) + wxT(":") + StripProtocolAnchor(location);
|
GetProtocol(location) + wxT(":") + StripProtocolAnchor(location);
|
||||||
|
|
||||||
@@ -130,6 +134,7 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs),
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (wxFSFile*) NULL; // incorrect URL
|
return (wxFSFile*) NULL; // incorrect URL
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -760,6 +760,9 @@ bool wxFTP::Abort()
|
|||||||
|
|
||||||
wxInputStream *wxFTP::GetInputStream(const wxString& path)
|
wxInputStream *wxFTP::GetInputStream(const wxString& path)
|
||||||
{
|
{
|
||||||
|
#if !wxUSE_URL
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
if ( ( m_currentTransfermode == NONE ) && !SetTransferMode(BINARY) )
|
if ( ( m_currentTransfermode == NONE ) && !SetTransferMode(BINARY) )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@@ -786,6 +789,7 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path)
|
|||||||
wxInputFTPStream *in_stream = new wxInputFTPStream(this, sock);
|
wxInputFTPStream *in_stream = new wxInputFTPStream(this, sock);
|
||||||
|
|
||||||
return in_stream;
|
return in_stream;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxOutputStream *wxFTP::GetOutputStream(const wxString& path)
|
wxOutputStream *wxFTP::GetOutputStream(const wxString& path)
|
||||||
|
@@ -45,8 +45,12 @@ wxProtoInfo::wxProtoInfo(const wxChar *name, const wxChar *serv,
|
|||||||
{
|
{
|
||||||
m_cinfo = info;
|
m_cinfo = info;
|
||||||
m_needhost = need_host1;
|
m_needhost = need_host1;
|
||||||
|
#if wxUSE_URL
|
||||||
next = wxURL::ms_protocols;
|
next = wxURL::ms_protocols;
|
||||||
wxURL::ms_protocols = this;
|
wxURL::ms_protocols = this;
|
||||||
|
#else
|
||||||
|
next = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
|
@@ -43,6 +43,9 @@ wxFileProto::~wxFileProto()
|
|||||||
|
|
||||||
wxInputStream *wxFileProto::GetInputStream(const wxString& path)
|
wxInputStream *wxFileProto::GetInputStream(const wxString& path)
|
||||||
{
|
{
|
||||||
|
#if !wxUSE_URL
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
wxFileInputStream* retval = new wxFileInputStream(wxURL::ConvertFromURI(path));
|
wxFileInputStream* retval = new wxFileInputStream(wxURL::ConvertFromURI(path));
|
||||||
if (retval->Ok()) {
|
if (retval->Ok()) {
|
||||||
return retval;
|
return retval;
|
||||||
@@ -50,6 +53,7 @@ wxInputStream *wxFileProto::GetInputStream(const wxString& path)
|
|||||||
delete retval;
|
delete retval;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE
|
#endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE
|
||||||
|
Reference in New Issue
Block a user