Skip to content

Use vtksys::ifstream and vtksys::ofstream

David Gobbi requested to merge dgobbi/paraview:vtksys-fstream into master

This updates the classes that previously used <fstream> so that they instead use vtksys::ifstream and vtksys::ofstream. This is for compatibility with vtk!6301.

The use of the vtksys:: APIs for system calls allows control of the Windows character set encoding via the CMake variable KWSYS_ENCODING_DEFAULT_CODEPAGE. Setting this CP_UTF8 causes vtksys to use utf-8 encoding for filenames.

Note that not all IO is done via ifstream/ofstream, so as it stands this commit is an incomplete solution. Follow-ups commits should be added which do the following:

  1. when C files are used, replace fopen() with vtksys::SystemTools::Fopen().

  2. when a third-party IO library is used, if a 'std::wstring' or 'wchar_t' API is available, then use vtksys to encode/decode the filename.

Edited by David Gobbi

Merge request reports