]>
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
);
36 size_t GetSize() const;
38 bool Ok() const { return m_file
->IsOpened(); }
43 size_t OnSysRead(void *buffer
, size_t size
);
44 off_t
OnSysSeek(off_t pos
, wxSeekMode mode
);
45 off_t
OnSysTell() const;
52 class wxFileOutputStream
: public wxOutputStream
{
54 wxFileOutputStream(const wxString
& fileName
);
55 wxFileOutputStream(wxFile
& file
);
56 wxFileOutputStream(int fd
);
57 virtual ~wxFileOutputStream();
59 // To solve an ambiguity on GCC
60 // inline wxOutputStream& Write(const void *buffer, size_t size)
61 // { return wxOutputStream::Write(buffer, size); }
64 size_t GetSize() const;
66 bool Ok() const { return m_file
->IsOpened(); }
71 size_t OnSysWrite(const void *buffer
, size_t size
);
72 off_t
OnSysSeek(off_t pos
, wxSeekMode mode
);
73 off_t
OnSysTell() const;
80 class wxFileStream
: public wxFileInputStream
, public wxFileOutputStream
{
82 wxFileStream(const wxString
& fileName
);
86 // wxUSE_STREAMS && wxUSE_FILE