summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2014-01-04 05:47:13 (GMT)
committerBrad King <brad.king@kitware.com>2014-01-07 14:27:44 (GMT)
commit5730710c86e5b844c48e17e9001647ae0aa841a3 (patch)
tree95f04b085aab74156bbbd39089541c6ec586b89c /Source/cmcmd.cxx
parent7fb2b806626b9af791d7372d2ff82b2cf1503237 (diff)
downloadCMake-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/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index d3b7b5f..7891969 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -23,6 +23,7 @@
#include <cmsys/Directory.hxx>
#include <cmsys/Process.h>
+#include <cmsys/FStream.hxx>
#if defined(CMAKE_HAVE_VS_GENERATORS)
#include "cmCallVisualStudioMacro.h"
@@ -376,7 +377,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
cmSystemTools::RemoveADirectory(dirName.c_str());
// is the last argument a filename that exists?
- FILE *countFile = fopen(args[3].c_str(),"r");
+ FILE *countFile = cmsys::SystemTools::Fopen(args[3].c_str(),"r");
int count;
if (countFile)
{
@@ -396,7 +397,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// write the count into the directory
std::string fName = dirName;
fName += "/count.txt";
- FILE *progFile = fopen(fName.c_str(),"w");
+ FILE *progFile = cmsys::SystemTools::Fopen(fName.c_str(),"w");
if (progFile)
{
fprintf(progFile,"%i\n",count);
@@ -417,7 +418,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// read the count
fName = dirName;
fName += "/count.txt";
- progFile = fopen(fName.c_str(),"r");
+ progFile = cmsys::SystemTools::Fopen(fName.c_str(),"r");
int count = 0;
if (!progFile)
{
@@ -437,7 +438,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
fName = dirName;
fName += "/";
fName += args[i];
- progFile = fopen(fName.c_str(),"w");
+ progFile = cmsys::SystemTools::Fopen(fName.c_str(),"w");
if (progFile)
{
fprintf(progFile,"empty");
@@ -946,7 +947,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string>& args)
cmsysProcess_SetOption(cp, cmsysProcess_Option_Verbatim, 1);
// Read command lines from the script.
- std::ifstream fin(args[2].c_str());
+ cmsys::ifstream fin(args[2].c_str());
if(!fin)
{
std::cerr << "Error opening link script \""
@@ -1057,7 +1058,7 @@ int cmcmd::VisualStudioLink(std::vector<std::string>& args, int type)
// check for nmake temporary files
if((*i)[0] == '@' && i->find("@CMakeFiles") != 0 )
{
- std::ifstream fin(i->substr(1).c_str());
+ cmsys::ifstream fin(i->substr(1).c_str());
std::string line;
while(cmSystemTools::GetLineFromStream(fin,
line))
@@ -1229,7 +1230,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
std::cout << "Create " << resourceInputFile.c_str() << "\n";
}
// Create input file for rc command
- std::ofstream fout(resourceInputFile.c_str());
+ cmsys::ofstream fout(resourceInputFile.c_str());
if(!fout)
{
return -1;
@@ -1252,7 +1253,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
{
std::cout << "Create empty: " << manifestFile.c_str() << "\n";
}
- std::ofstream foutTmp(manifestFile.c_str());
+ cmsys::ofstream foutTmp(manifestFile.c_str());
}
std::string resourceFile = manifestFile;
resourceFile += ".res";