]>
Commit | Line | Data |
---|---|---|
f4ada568 | 1 | ///////////////////////////////////////////////////////////////////////////// |
8898456d | 2 | // Name: src/common/sckfile.cpp |
f4ada568 GL |
3 | // Purpose: File protocol |
4 | // Author: Guilhem Lavaux | |
5 | // Modified by: | |
6 | // Created: 20/07/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1997, 1998 Guilhem Lavaux | |
65571936 | 9 | // Licence: wxWindows licence |
f4ada568 | 10 | ///////////////////////////////////////////////////////////////////////////// |
fcc6dddd JS |
11 | |
12 | // For compilers that support precompilation, includes "wx.h". | |
13 | #include "wx/wxprec.h" | |
f4ada568 GL |
14 | |
15 | #ifdef __BORLANDC__ | |
8898456d | 16 | #pragma hdrstop |
f4ada568 GL |
17 | #endif |
18 | ||
8898456d WS |
19 | #if wxUSE_STREAMS && wxUSE_PROTOCOL_FILE |
20 | ||
fcc6dddd JS |
21 | #ifndef WX_PRECOMP |
22 | #endif | |
23 | ||
24 | #include <stdio.h> | |
3096bd2f VZ |
25 | #include "wx/wfstream.h" |
26 | #include "wx/protocol/file.h" | |
fcc6dddd | 27 | |
f4ada568 | 28 | IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol) |
d775fa82 | 29 | IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, false) |
f4ada568 GL |
30 | |
31 | wxFileProto::wxFileProto() | |
3a082780 | 32 | : wxProtocol() |
f4ada568 | 33 | { |
3a082780 | 34 | m_error = wxPROTO_NOERR; |
f4ada568 GL |
35 | } |
36 | ||
37 | wxFileProto::~wxFileProto() | |
38 | { | |
39 | } | |
40 | ||
41 | wxInputStream *wxFileProto::GetInputStream(const wxString& path) | |
42 | { | |
3a082780 VZ |
43 | wxFileInputStream *retval = new wxFileInputStream(wxURI::Unescape(path)); |
44 | if ( retval->Ok() ) | |
45 | { | |
46 | m_error = wxPROTO_NOERR; | |
47 | ||
48 | return retval; | |
49 | } | |
50 | ||
51 | m_error = wxPROTO_NOFILE; | |
b1755cdb | 52 | delete retval; |
3a082780 VZ |
53 | |
54 | return NULL; | |
f4ada568 | 55 | } |
35a4dab7 | 56 | |
ef0e85f3 | 57 | #endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE |