]> git.saurik.com Git - wxWidgets.git/blame - include/wx/textfile.h
Added WX_DEFINE_*_USER_EXPORTED_ARRAY macros for external dlls.
[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>
11// Licence: wxWindows license
12///////////////////////////////////////////////////////////////////////////////
13
a1b82138
VZ
14#ifndef _WX_TEXTFILE_H
15#define _WX_TEXTFILE_H
c801d85f
KB
16
17#ifdef __GNUG__
a1b82138 18 #pragma interface "textfile.h"
c801d85f
KB
19#endif
20
21#include "wx/defs.h"
ce4169a4 22
d8edb385
VZ
23#if wxUSE_TEXTFILE
24
d8edb385 25#include "wx/file.h"
a3a584a7 26#include "wx/textbuf.h"
d8edb385
VZ
27
28// ----------------------------------------------------------------------------
29// wxTextFile
30// ----------------------------------------------------------------------------
31
a3a584a7 32class WXDLLEXPORT wxTextFile : public wxTextBuffer
c801d85f
KB
33{
34public:
a3a584a7
VZ
35 // constructors
36 wxTextFile() { }
37 wxTextFile(const wxString& strFileName);
38
39protected:
40 // implement the base class pure virtuals
41 virtual bool OnExists() const;
42 virtual bool OnOpen(const wxString &strBufferName,
43 wxTextBufferOpenMode OpenMode);
44 virtual bool OnClose();
45 virtual bool OnRead(wxMBConv& conv);
46 virtual bool OnWrite(wxTextFileType typeNew, wxMBConv& conv = wxConvLibc);
c801d85f
KB
47
48private:
a3a584a7 49 wxFile m_file;
c801d85f
KB
50};
51
a1b82138 52#else // !wxUSE_TEXTFILE
ce4169a4 53
a3a584a7
VZ
54// old code relies on the static methods of wxTextFile being always available
55// and they still are available in wxTextBuffer (even if !wxUSE_TEXTBUFFER), so
56// make it possible to use them in a backwards compatible way
57typedef wxTextBuffer wxTextFile;
a1b82138 58
a3a584a7 59#endif // wxUSE_TEXTFILE/!wxUSE_TEXTFILE
a1b82138
VZ
60
61#endif // _WX_TEXTFILE_H
9f04ccb1 62