]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/wfstream.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: File stream classes
4 // Author: Guilhem Lavaux
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_WXFSTREAM_H__
13 #define _WX_WXFSTREAM_H__
16 #pragma interface "wfstream.h"
21 #if wxUSE_STREAMS && wxUSE_FILE
23 #include <wx/object.h>
24 #include <wx/string.h>
25 #include <wx/stream.h>
28 class wxFileInputStream
: public wxInputStream
{
30 wxFileInputStream(const wxString
& ifileName
);
31 wxFileInputStream(wxFile
& file
);
32 wxFileInputStream(int fd
);
35 size_t GetSize() const;
37 bool Ok() const { return m_file
->IsOpened(); }
42 size_t OnSysRead(void *buffer
, size_t size
);
43 off_t
OnSysSeek(off_t pos
, wxSeekMode mode
);
44 off_t
OnSysTell() const;
51 class wxFileOutputStream
: public wxOutputStream
{
53 wxFileOutputStream(const wxString
& fileName
);
54 wxFileOutputStream(wxFile
& file
);
55 wxFileOutputStream(int fd
);
56 virtual ~wxFileOutputStream();
58 // To solve an ambiguity on GCC
59 // inline wxOutputStream& Write(const void *buffer, size_t size)
60 // { return wxOutputStream::Write(buffer, size); }
63 size_t GetSize() const;
65 bool Ok() const { return m_file
->IsOpened(); }
70 size_t OnSysWrite(const void *buffer
, size_t size
);
71 off_t
OnSysSeek(off_t pos
, wxSeekMode mode
);
72 off_t
OnSysTell() const;
79 class wxFileStream
: public wxFileInputStream
, public wxFileOutputStream
{
81 wxFileStream(const wxString
& fileName
);
85 // wxUSE_STREAMS && wxUSE_FILE