]> git.saurik.com Git - wxWidgets.git/blame - src/common/sckfile.cpp
wxDisplay cleanup/rewrite:
[wxWidgets.git] / src / common / sckfile.cpp
CommitLineData
f4ada568
GL
1/////////////////////////////////////////////////////////////////////////////
2// Name: sckfile.cpp
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__
ce4169a4 16 #pragma hdrstop
f4ada568
GL
17#endif
18
fcc6dddd 19#ifndef WX_PRECOMP
ce4169a4 20 #include "wx/defs.h"
fcc6dddd
JS
21#endif
22
ef0e85f3 23#if wxUSE_STREAMS && wxUSE_PROTOCOL_FILE
f6bcfd97 24
fcc6dddd 25#include <stdio.h>
3096bd2f
VZ
26#include "wx/wfstream.h"
27#include "wx/protocol/file.h"
fcc6dddd 28
f4ada568 29IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol)
d775fa82 30IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, false)
f4ada568
GL
31
32wxFileProto::wxFileProto()
3a082780 33 : wxProtocol()
f4ada568 34{
3a082780 35 m_error = wxPROTO_NOERR;
f4ada568
GL
36}
37
38wxFileProto::~wxFileProto()
39{
40}
41
42wxInputStream *wxFileProto::GetInputStream(const wxString& path)
43{
3a082780
VZ
44 wxFileInputStream *retval = new wxFileInputStream(wxURI::Unescape(path));
45 if ( retval->Ok() )
46 {
47 m_error = wxPROTO_NOERR;
48
49 return retval;
50 }
51
52 m_error = wxPROTO_NOFILE;
b1755cdb 53 delete retval;
3a082780
VZ
54
55 return NULL;
f4ada568 56}
35a4dab7 57
ef0e85f3 58#endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE
f6bcfd97 59