]>
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 __WXFSTREAM_H__
12 #define __WXFSTREAM_H__
14 #include <wx/object.h>
15 #include <wx/string.h>
16 #include <wx/stream.h>
19 class wxFileInputStream
: public wxInputStream
, virtual public wxFile
{
21 wxFileInputStream(const wxString
& fileName
);
22 virtual ~wxFileInputStream();
26 virtual bool Eof() const { return wxFile::Eof(); }
28 bool Ok() const { return wxFile::IsOpened(); }
31 wxFileInputStream() {}
33 size_t DoRead(void *buffer
, size_t size
);
34 off_t
DoSeekInput(off_t pos
, wxSeekMode mode
);
35 off_t
DoTellInput() const;
38 class wxFileOutputStream
: public wxOutputStream
, virtual public wxFile
{
40 wxFileOutputStream(const wxString
& fileName
);
41 virtual ~wxFileOutputStream();
43 // To solve an ambiguity on GCC
44 inline wxOutputStream
& Write(const void *buffer
, size_t size
)
45 { return wxOutputStream::Write(buffer
, size
); }
49 bool Ok() const { return wxFile::IsOpened(); }
52 wxFileOutputStream() {}
54 size_t DoWrite(const void *buffer
, size_t size
);
55 off_t
DoSeekOutput(off_t pos
, wxSeekMode mode
);
56 off_t
DoTellOutput() const;
59 class wxFileStream
: public wxFileInputStream
, public wxFileOutputStream
{
61 wxFileStream(const wxString
& fileName
);
62 virtual ~wxFileStream();