]>
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 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_WXFSTREAM_H__
13 #define _WX_WXFSTREAM_H__
16 #pragma interface "fstream.h"
19 #include <wx/object.h>
20 #include <wx/string.h>
21 #include <wx/stream.h>
24 // Disable warnings such as
25 // 'wxFileStream' : inherits 'wxFileInputStream::Peek' via dominance
28 #pragma warning(disable:4250)
31 class wxFileStreamBase
{
37 class wxFileInputStream
: public virtual wxInputStream
,
38 public virtual wxFileStreamBase
{
40 wxFileInputStream(const wxString
& fileName
);
41 virtual ~wxFileInputStream();
45 bool Ok() const { return m_file
->IsOpened(); }
50 size_t DoRead(void *buffer
, size_t size
);
51 off_t
DoSeekInput(off_t pos
, wxSeekMode mode
);
52 off_t
DoTellInput() const;
55 class wxFileOutputStream
: public virtual wxOutputStream
,
56 public virtual wxFileStreamBase
{
58 wxFileOutputStream(const wxString
& fileName
);
59 virtual ~wxFileOutputStream();
61 // To solve an ambiguity on GCC
62 inline wxOutputStream
& Write(const void *buffer
, size_t size
)
63 { return wxOutputStream::Write(buffer
, size
); }
67 bool Ok() const { return m_file
->IsOpened(); }
72 size_t DoWrite(const void *buffer
, size_t size
);
73 off_t
DoSeekOutput(off_t pos
, wxSeekMode mode
);
74 off_t
DoTellOutput() const;
77 class wxFileStream
: public wxStream
,
78 public wxFileInputStream
, public wxFileOutputStream
{
80 wxFileStream(const wxString
& fileName
);
81 virtual ~wxFileStream();
85 #pragma warning(default:4250)