file classes and functions overviewclasses: wxfile, wxdir, wxtempfile, wxtextfile functions: see file functions. wxwidgets provides some functions and classes to facilitate working with files. as usual, the accent is put on cross-platform features which explains, for example, the wxtextfile class which may be used to convert between different types of text files (dos/unix/mac). wxfile may be used for low-level io. it contains all the usual functions to work with files (opening/closing, reading/writing, seeking, and so on) but compared with using standard c functions, has error checking (in case of an error a message is logged using wxlog facilities) and closes the file automatically in the destructor which may be quite convenient. wxtempfile is a very small file designed to make replacing the files contents safer - see its documentation for more details. wxtextfile is a general purpose class for working with small text files on line by line basis. it is especially well suited for working with configuration files and program source files. it can be also used to work with files with "non native" line termination characters and write them as "native" files if needed (in fact, the files may be written in any format). wxdir is a helper class for enumerating the files or subdirectories of a directory. it may be used to enumerate all files, only files satisfying the given template mask or only non-hidden files.
|