]>
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
: virtual public wxFile
, public wxInputStream
{
21 wxFileInputStream(const wxString
& fileName
);
22 virtual ~wxFileInputStream();
24 wxInputStream
& Read(void *buffer
, size_t size
);
25 off_t
SeekI(off_t pos
, wxSeekMode mode
= wxFromStart
);
28 bool Eof() const { return m_eof
; }
29 size_t LastRead() const { return m_lastread
; }
31 bool Ok() const { return wxFile::IsOpened(); }
34 wxFileInputStream() {}
42 class wxFileOutputStream
: virtual wxFile
, public wxOutputStream
{
44 wxFileOutputStream(const wxString
& fileName
);
45 virtual ~wxFileOutputStream();
47 wxOutputStream
& Write(const void *buffer
, size_t size
);
48 off_t
SeekO(off_t pos
, wxSeekMode mode
= wxFromStart
);
51 bool Bad() const { return m_bad
; }
52 size_t LastWrite() const { return m_lastwrite
; }
56 bool IsOpened() const { return wxFile::IsOpened(); }
59 wxFileOutputStream() {}
66 class wxFileStream
: public wxFileInputStream
, public wxFileOutputStream
{
68 wxFileStream(const wxString
& fileName
);
69 virtual ~wxFileStream();