1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: class wxTextFile to work with text files of _small_ size
4 // (file is fully loaded in memory) and which understands CR/LF
5 // differences between platforms.
6 // Author: Vadim Zeitlin
10 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
11 // Licence: wxWindows licence
12 ///////////////////////////////////////////////////////////////////////////////
14 #ifndef _WX_TEXTFILE_H
15 #define _WX_TEXTFILE_H
17 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
18 #pragma interface "textfile.h"
23 #include "wx/textbuf.h"
29 // ----------------------------------------------------------------------------
31 // ----------------------------------------------------------------------------
33 class WXDLLIMPEXP_BASE wxTextFile
: public wxTextBuffer
38 wxTextFile(const wxString
& strFileName
);
41 // implement the base class pure virtuals
42 virtual bool OnExists() const;
43 virtual bool OnOpen(const wxString
&strBufferName
,
44 wxTextBufferOpenMode OpenMode
);
45 virtual bool OnClose();
46 virtual bool OnRead(wxMBConv
& conv
);
47 virtual bool OnWrite(wxTextFileType typeNew
, wxMBConv
& conv
);
53 DECLARE_NO_COPY_CLASS(wxTextFile
)
56 #else // !wxUSE_TEXTFILE
58 // old code relies on the static methods of wxTextFile being always available
59 // and they still are available in wxTextBuffer (even if !wxUSE_TEXTBUFFER), so
60 // make it possible to use them in a backwards compatible way
61 typedef wxTextBuffer wxTextFile
;
63 #endif // wxUSE_TEXTFILE/!wxUSE_TEXTFILE
65 #endif // _WX_TEXTFILE_H