summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-07 14:39:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-01-07 14:39:17 (GMT)
commit3a024ce0d8aeec991297b7997a872093176e373e (patch)
treea9f0f79d5ae489ccb3d352ce71f1d0f8c81354aa /Source/CPack
parent91dcc9bef390f6644e1a357ed2226f350742f49b (diff)
parent5730710c86e5b844c48e17e9001647ae0aa841a3 (diff)
downloadCMake-3a024ce0d8aeec991297b7997a872093176e373e.zip
CMake-3a024ce0d8aeec991297b7997a872093176e373e.tar.gz
CMake-3a024ce0d8aeec991297b7997a872093176e373e.tar.bz2
Merge topic 'unicode-fstream'
5730710 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/OSXScriptLauncher.cxx4
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx5
-rw-r--r--Source/CPack/WiX/cmWIXRichTextFormatWriter.h4
-rw-r--r--Source/CPack/WiX/cmWIXSourceWriter.h4
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx5
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx5
9 files changed, 21 insertions, 16 deletions
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx
index a9842c1..d9d6236 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -11,8 +11,8 @@
============================================================================*/
#include <cmsys/SystemTools.hxx>
#include <cmsys/Process.h>
-#include <cmsys/ios/fstream>
#include <cmsys/ios/iostream>
+#include <cmsys/FStream.hxx>
#include <CoreFoundation/CoreFoundation.h>
@@ -27,7 +27,7 @@ int main(int argc, char* argv[])
{
//if ( cmsys::SystemTools::FileExists(
cmsys_stl::string cwd = cmsys::SystemTools::GetCurrentWorkingDirectory();
- cmsys_ios::ofstream ofs("/tmp/output.txt");
+ cmsys::ofstream ofs("/tmp/output.txt");
CFStringRef fileName;
CFBundleRef appBundle;
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 78e7339..a55a6a6 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -24,6 +24,7 @@
#include <cmsys/SystemTools.hxx>
#include <cmsys/Directory.hxx>
#include <cmsys/Encoding.hxx>
+#include <cmsys/FStream.hxx>
#include <rpc.h> // for GUID generation
@@ -56,7 +57,7 @@ bool cmCPackWIXGenerator::RunWiXCommand(const std::string& command)
bool status = cmSystemTools::RunSingleCommand(command.c_str(), &output,
&returnValue, 0, cmSystemTools::OUTPUT_NONE);
- std::ofstream logFile(logFileName.c_str(), std::ios::app);
+ cmsys::ofstream logFile(logFileName.c_str(), std::ios::app);
logFile << command << std::endl;
logFile << output;
logFile.close();
@@ -838,7 +839,7 @@ bool cmCPackWIXGenerator::CreateLicenseFile()
{
cmWIXRichTextFormatWriter rtfWriter(licenseDestinationFilename);
- std::ifstream licenseSource(licenseSourceFilename.c_str());
+ cmsys::ifstream licenseSource(licenseSourceFilename.c_str());
std::string line;
while(std::getline(licenseSource, line))
diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
index 38e40b0..2b665d4 100644
--- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
+++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
@@ -13,7 +13,7 @@
#ifndef cmWIXRichTextFormatWriter_h
#define cmWIXRichTextFormatWriter_h
-#include <fstream>
+#include <cmsys/FStream.hxx>
/** \class cmWIXRichtTextFormatWriter
* \brief Helper class to generate Rich Text Format (RTF) documents
@@ -46,7 +46,7 @@ private:
void EmitInvalidCodepoint(int c);
- std::ofstream File;
+ cmsys::ofstream File;
};
#endif
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h
index f291d25..894ad78 100644
--- a/Source/CPack/WiX/cmWIXSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXSourceWriter.h
@@ -15,7 +15,7 @@
#include <vector>
#include <string>
-#include <fstream>
+#include <cmsys/FStream.hxx>
#include <CPack/cmCPackLog.h>
@@ -60,7 +60,7 @@ private:
cmCPackLog* Logger;
- std::ofstream File;
+ cmsys::ofstream File;
State State;
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 4494e8a..0162d55 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -803,7 +803,7 @@ static int put_arobj(CF *cfp, struct stat *sb)
static int ar_append(const char* archive,const std::vector<std::string>& files)
{
int eval = 0;
- FILE* aFile = fopen(archive, "wb+");
+ FILE* aFile = cmSystemTools::Fopen(archive, "wb+");
if (aFile!=NULL) {
fwrite(ARMAG, SARMAG, 1, aFile);
if (fseek(aFile, 0, SEEK_END) != -1) {
@@ -814,7 +814,7 @@ static int ar_append(const char* archive,const std::vector<std::string>& files)
for(std::vector<std::string>::const_iterator fileIt = files.begin();
fileIt!=files.end(); ++fileIt) {
const char* filename = fileIt->c_str();
- FILE* file = fopen(filename, "rb");
+ FILE* file = cmSystemTools::Fopen(filename, "rb");
if (file == NULL) {
eval = -1;
continue;
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index dfb2f15..9f0a77e 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -16,6 +16,7 @@
#include "cmGeneratedFileStream.h"
#include <cmsys/RegularExpression.hxx>
+#include <cmsys/FStream.hxx>
static const char* SLAHeader =
"data 'LPic' (5000) {\n"
@@ -422,7 +423,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::string sla_r = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
sla_r += "/sla.r";
- std::ifstream ifs;
+ cmsys::ifstream ifs;
ifs.open(cpack_license_file.c_str());
if(ifs.is_open())
{
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index cd2fcc7..96491aa 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -23,6 +23,7 @@
#include <cmsys/SystemTools.hxx>
#include <cmsys/Glob.hxx>
+#include <cmsys/FStream.hxx>
#include <algorithm>
#if defined(__HAIKU__)
@@ -152,7 +153,7 @@ int cmCPackGenerator::PrepareNames()
<< descFileName << "]" << std::endl);
return 0;
}
- std::ifstream ifs(descFileName);
+ cmsys::ifstream ifs(descFileName);
if ( !ifs )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index c617a3e..c5b9c6f 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -22,6 +22,7 @@
#include <cmsys/SystemTools.hxx>
#include <cmsys/Glob.hxx>
+#include <cmsys/FStream.hxx>
//----------------------------------------------------------------------
cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator()
@@ -467,7 +468,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
return 0;
}
- std::ifstream ifs(versionFile.c_str());
+ cmsys::ifstream ifs(versionFile.c_str());
if ( !ifs )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -716,7 +717,7 @@ GenerateComponentPackage(const char *packageFile,
// X packages, which work on Mac OS X 10.3 and newer.
std::string descriptionFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
descriptionFile += '/' + component.Name + "-Description.plist";
- std::ofstream out(descriptionFile.c_str());
+ cmsys::ofstream out(descriptionFile.c_str());
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl
<< "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\""
<< "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" << std::endl
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index 9b6cf14..8342fee 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -20,6 +20,7 @@
#include "cmCPackLog.h"
#include <cmsys/ios/sstream>
+#include <cmsys/FStream.hxx>
#include <sys/types.h>
#include <sys/stat.h>
@@ -91,7 +92,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
std::string inLicFile = this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
std::string line;
- std::ifstream ilfs(inLicFile.c_str());
+ cmsys::ifstream ilfs(inLicFile.c_str());
std::string licenseText;
while ( cmSystemTools::GetLineFromStream(ilfs, line) )
{
@@ -104,7 +105,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
// Create the header
std::string inFile = this->GetOption("CPACK_STGZ_HEADER_FILE");
- std::ifstream ifs(inFile.c_str());
+ cmsys::ifstream ifs(inFile.c_str());
std::string packageHeaderText;
while ( cmSystemTools::GetLineFromStream(ifs, line) )
{