1998-05-20 14:01:55 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2001-11-14 20:40:20 +00:00
|
|
|
// Name: wx/textfile.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose: class wxTextFile to work with text files of _small_ size
|
|
|
|
// (file is fully loaded in memory) and which understands CR/LF
|
|
|
|
// differences between platforms.
|
|
|
|
// Author: Vadim Zeitlin
|
1999-03-16 18:44:38 +00:00
|
|
|
// Modified by:
|
1998-05-20 14:01:55 +00:00
|
|
|
// Created: 03.04.98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
2003-03-17 10:34:04 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-07-14 22:55:57 +00:00
|
|
|
#ifndef _WX_TEXTFILE_H
|
|
|
|
#define _WX_TEXTFILE_H
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2002-08-31 11:29:13 +00:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
1999-07-14 22:55:57 +00:00
|
|
|
#pragma interface "textfile.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-06-15 20:21:59 +00:00
|
|
|
|
2001-11-25 00:20:56 +00:00
|
|
|
#include "wx/textbuf.h"
|
|
|
|
|
2000-12-05 22:38:43 +00:00
|
|
|
#if wxUSE_TEXTFILE
|
|
|
|
|
|
|
|
#include "wx/file.h"
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxTextFile
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_BASE wxTextFile : public wxTextBuffer
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
|
|
|
public:
|
2001-11-14 20:40:20 +00:00
|
|
|
// constructors
|
|
|
|
wxTextFile() { }
|
|
|
|
wxTextFile(const wxString& strFileName);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// implement the base class pure virtuals
|
|
|
|
virtual bool OnExists() const;
|
|
|
|
virtual bool OnOpen(const wxString &strBufferName,
|
|
|
|
wxTextBufferOpenMode OpenMode);
|
|
|
|
virtual bool OnClose();
|
|
|
|
virtual bool OnRead(wxMBConv& conv);
|
2002-12-04 14:11:26 +00:00
|
|
|
virtual bool OnWrite(wxTextFileType typeNew, wxMBConv& conv);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
private:
|
2001-11-14 20:40:20 +00:00
|
|
|
wxFile m_file;
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1999-07-14 22:55:57 +00:00
|
|
|
#else // !wxUSE_TEXTFILE
|
1999-06-15 20:21:59 +00:00
|
|
|
|
2001-11-14 20:40:20 +00:00
|
|
|
// old code relies on the static methods of wxTextFile being always available
|
|
|
|
// and they still are available in wxTextBuffer (even if !wxUSE_TEXTBUFFER), so
|
|
|
|
// make it possible to use them in a backwards compatible way
|
|
|
|
typedef wxTextBuffer wxTextFile;
|
1999-07-14 22:55:57 +00:00
|
|
|
|
2001-11-14 20:40:20 +00:00
|
|
|
#endif // wxUSE_TEXTFILE/!wxUSE_TEXTFILE
|
1999-07-14 22:55:57 +00:00
|
|
|
|
|
|
|
#endif // _WX_TEXTFILE_H
|
1999-06-30 04:28:29 +00:00
|
|
|
|