]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/fstream.h
384a614bc4c9402715d73f26d67d060e1c36872a
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
: virtual public wxFile
, public wxInputStream
{
20 DECLARE_CLASS(wxFileInputStream
)
22 wxFileInputStream(const wxString
& fileName
);
23 virtual ~wxFileInputStream();
25 wxInputStream
& Read(void *buffer
, size_t size
);
26 off_t
SeekI(off_t pos
, wxSeekMode mode
= wxFromStart
);
29 bool Eof() const { return m_eof
; }
30 size_t LastRead() const { return m_lastread
; }
32 bool Ok() const { return wxFile::IsOpened(); }
35 wxFileInputStream() {}
43 class wxFileOutputStream
: virtual wxFile
, public wxOutputStream
{
44 DECLARE_CLASS(wxFileOutputStream
)
46 wxFileOutputStream(const wxString
& fileName
);
47 virtual ~wxFileOutputStream();
49 wxOutputStream
& Write(const void *buffer
, size_t size
);
50 off_t
SeekO(off_t pos
, wxSeekMode mode
= wxFromStart
);
53 bool Bad() const { return m_bad
; }
54 size_t LastWrite() const { return m_lastwrite
; }
58 bool IsOpened() const { return wxFile::IsOpened(); }
61 wxFileOutputStream() {}
68 class wxFileStream
: public wxFileInputStream
, public wxFileOutputStream
{
69 DECLARE_CLASS(wxFileStream
)
71 wxFileStream(const wxString
& fileName
);
72 virtual ~wxFileStream();