]> git.saurik.com Git - wxWidgets.git/blame - include/wx/textfile.h
applied heavily modified patch 1116702: support for specifying disabled toolbar image...
[wxWidgets.git] / include / wx / textfile.h
CommitLineData
c801d85f 1///////////////////////////////////////////////////////////////////////////////
a3a584a7 2// Name: wx/textfile.h
c801d85f
KB
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
f42d2aba 7// Modified by:
c801d85f
KB
8// Created: 03.04.98
9// RCS-ID: $Id$
10// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
65571936 11// Licence: wxWindows licence
c801d85f
KB
12///////////////////////////////////////////////////////////////////////////////
13
a1b82138
VZ
14#ifndef _WX_TEXTFILE_H
15#define _WX_TEXTFILE_H
c801d85f 16
12028905 17#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
a1b82138 18 #pragma interface "textfile.h"
c801d85f
KB
19#endif
20
21#include "wx/defs.h"
ce4169a4 22
d63819e0
VZ
23#include "wx/textbuf.h"
24
d8edb385
VZ
25#if wxUSE_TEXTFILE
26
d8edb385 27#include "wx/file.h"
d8edb385
VZ
28
29// ----------------------------------------------------------------------------
30// wxTextFile
31// ----------------------------------------------------------------------------
32
bddd7a8d 33class WXDLLIMPEXP_BASE wxTextFile : public wxTextBuffer
c801d85f
KB
34{
35public:
a3a584a7
VZ
36 // constructors
37 wxTextFile() { }
38 wxTextFile(const wxString& strFileName);
39
40protected:
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);
2b5f62a0 47 virtual bool OnWrite(wxTextFileType typeNew, wxMBConv& conv);
c801d85f
KB
48
49private:
fc7a2a60 50
a3a584a7 51 wxFile m_file;
fc7a2a60
VZ
52
53 DECLARE_NO_COPY_CLASS(wxTextFile)
c801d85f
KB
54};
55
a1b82138 56#else // !wxUSE_TEXTFILE
ce4169a4 57
a3a584a7
VZ
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
61typedef wxTextBuffer wxTextFile;
a1b82138 62
a3a584a7 63#endif // wxUSE_TEXTFILE/!wxUSE_TEXTFILE
a1b82138
VZ
64
65#endif // _WX_TEXTFILE_H
9f04ccb1 66