]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/fstream.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: File stream classes
4 // Author: Guilhem Lavaux
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_WXFSTREAM_H__
12 #define _WX_WXFSTREAM_H__
14 #include <wx/object.h>
15 #include <wx/string.h>
16 #include <wx/stream.h>
19 class wxFileStreamBase
{
25 class wxFileInputStream
: virtual public wxInputStream
,
26 virtual public wxFileStreamBase
{
28 wxFileInputStream(const wxString
& fileName
);
29 virtual ~wxFileInputStream();
33 bool Ok() const { return m_file
->IsOpened(); }
38 size_t DoRead(void *buffer
, size_t size
);
39 off_t
DoSeekInput(off_t pos
, wxSeekMode mode
);
40 off_t
DoTellInput() const;
43 class wxFileOutputStream
: virtual public wxOutputStream
,
44 virtual public wxFileStreamBase
{
46 wxFileOutputStream(const wxString
& fileName
);
47 virtual ~wxFileOutputStream();
49 // To solve an ambiguity on GCC
50 inline wxOutputStream
& Write(const void *buffer
, size_t size
)
51 { return wxOutputStream::Write(buffer
, size
); }
55 bool Ok() const { return m_file
->IsOpened(); }
60 size_t DoWrite(const void *buffer
, size_t size
);
61 off_t
DoSeekOutput(off_t pos
, wxSeekMode mode
);
62 off_t
DoTellOutput() const;
65 class wxFileStream
: public wxStream
,
66 public wxFileInputStream
, public wxFileOutputStream
{
68 wxFileStream(const wxString
& fileName
);
69 virtual ~wxFileStream();