diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2014-01-04 05:47:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-01-07 14:27:44 (GMT) |
commit | 5730710c86e5b844c48e17e9001647ae0aa841a3 (patch) | |
tree | 95f04b085aab74156bbbd39089541c6ec586b89c /Source/cmSystemTools.cxx | |
parent | 7fb2b806626b9af791d7372d2ff82b2cf1503237 (diff) | |
download | CMake-5730710c86e5b844c48e17e9001647ae0aa841a3.zip CMake-5730710c86e5b844c48e17e9001647ae0aa841a3.tar.gz CMake-5730710c86e5b844c48e17e9001647ae0aa841a3.tar.bz2 |
Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
Also use SystemTools::Fopen() instead of fopen().
This is to eventually support utf-8 filenames.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index b8163c8..e8e2007 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -32,6 +32,7 @@ # include <cmsys/Terminal.h> #endif #include <cmsys/stl/algorithm> +#include <cmsys/FStream.hxx> #if defined(_WIN32) # include <windows.h> @@ -1432,7 +1433,7 @@ bool cmSystemTools::CreateTar(const char* outFileName, { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); - std::ofstream fout(outFileName, std::ios::out | cmsys_ios_binary); + cmsys::ofstream fout(outFileName, std::ios::out | cmsys_ios_binary); if(!fout) { std::string e = "Cannot open output file \""; @@ -2037,7 +2038,7 @@ unsigned int cmSystemTools::RandomSeed() } seed; // Try using a real random source. - std::ifstream fin("/dev/urandom"); + cmsys::ifstream fin("/dev/urandom"); if(fin && fin.read(seed.bytes, sizeof(seed)) && fin.gcount() == sizeof(seed)) { @@ -2160,7 +2161,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0) // Build tree has "<build>/bin[/<config>]/cmake" and // "<build>/CMakeFiles/CMakeSourceDir.txt". std::string src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt"; - std::ifstream fin(src_dir_txt.c_str()); + cmsys::ifstream fin(src_dir_txt.c_str()); std::string src_dir; if(fin && cmSystemTools::GetLineFromStream(fin, src_dir) && cmSystemTools::FileIsDirectory(src_dir.c_str())) @@ -2171,7 +2172,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0) { dir = cmSystemTools::GetFilenamePath(dir); src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt"; - std::ifstream fin2(src_dir_txt.c_str()); + cmsys::ifstream fin2(src_dir_txt.c_str()); if(fin2 && cmSystemTools::GetLineFromStream(fin2, src_dir) && cmSystemTools::FileIsDirectory(src_dir.c_str())) { @@ -2506,7 +2507,7 @@ bool cmSystemTools::ChangeRPath(std::string const& file, { // Open the file for update. - std::ofstream f(file.c_str(), + cmsys::ofstream f(file.c_str(), std::ios::in | std::ios::out | std::ios::binary); if(!f) { @@ -2704,7 +2705,7 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg, } // Open the file for update. - std::ofstream f(file.c_str(), + cmsys::ofstream f(file.c_str(), std::ios::in | std::ios::out | std::ios::binary); if(!f) { |