Detailed Description

The wxTextFile is a simple class which allows to work with text files on line by line basis.

It also understands the differences in line termination characters under different platforms and will not do anything bad to files with "non
native" line termination sequences - in fact, it can be also used to modify the text files and change the line termination characters from one type (say DOS) to another (say Unix).

One word of warning: the class is not at all optimized for big files and thus it will load the file entirely into memory when opened. Of course, you should not work in this way with large files (as an estimation, anything over 1 Megabyte is surely too big for this class). On the other hand, it is not a serious limitation for small files like configuration files or program sources which are well handled by wxTextFile.

Create and open it: this is done with either wxTextFile::Create or wxTextFile::Open function which opens the file (name may be specified either as the argument to these functions or in the constructor), reads its contents in memory (in the case of wxTextFile::Open()) and closes it.

Save your changes: notice that the changes you make to the file will not be saved automatically; calling wxTextFile::Close or doing nothing discards them! To save the changes you must explicitly call wxTextFile::Write - here, you may also change the line termination type if you wish.

typeDefault is the value defined during the compilation and corresponds to the native format of the platform, i.e. it will be wxTextFileType_Dos under Windows and wxTextFileType_Unix under Unix (including OS X, the value wxTextFileType_Mac was only used for classic Mac OS versions).