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/CTest | |
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/CTest')
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.h | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestCVS.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 19 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestGIT.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 15 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 17 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.h | 10 | ||||
-rw-r--r-- | Source/CTest/cmParseCacheCoverage.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmParseGTMCoverage.cxx | 5 | ||||
-rw-r--r-- | Source/CTest/cmParseMumpsCoverage.cxx | 5 | ||||
-rw-r--r-- | Source/CTest/cmParsePHPCoverage.cxx | 13 | ||||
-rw-r--r-- | Source/CTest/cmParsePHPCoverage.h | 10 | ||||
-rw-r--r-- | Source/CTest/cmParsePythonCoverage.cxx | 4 |
18 files changed, 76 insertions, 64 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index e480fff..c5deb96 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -24,6 +24,7 @@ //#include <cmsys/RegularExpression.hxx> #include <cmsys/Process.h> #include <cmsys/Directory.hxx> +#include <cmsys/FStream.hxx> // used for sleep #ifdef _WIN32 @@ -751,7 +752,7 @@ void cmCTestBuildHandler::GenerateXMLFooter(std::ostream& os, void cmCTestBuildHandler::GenerateXMLLaunchedFragment(std::ostream& os, const char* fname) { - std::ifstream fin(fname, std::ios::in | std::ios::binary); + cmsys::ifstream fin(fname, std::ios::in | std::ios::binary); std::string line; while(cmSystemTools::GetLineFromStream(fin, line)) { @@ -885,7 +886,7 @@ cmCTestBuildHandler::LaunchHelper //---------------------------------------------------------------------- int cmCTestBuildHandler::RunMakeCommand(const char* command, - int* retVal, const char* dir, int timeout, std::ofstream& ofs) + int* retVal, const char* dir, int timeout, std::ostream& ofs) { // First generate the command and arguments std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); @@ -1049,7 +1050,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, //---------------------------------------------------------------------- void cmCTestBuildHandler::ProcessBuffer(const char* data, int length, - size_t& tick, size_t tick_len, std::ofstream& ofs, + size_t& tick, size_t tick_len, std::ostream& ofs, t_BuildProcessingQueueType* queue) { const std::string::size_type tick_line_len = 50; diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h index 439efd6..ff7cfd6 100644 --- a/Source/CTest/cmCTestBuildHandler.h +++ b/Source/CTest/cmCTestBuildHandler.h @@ -54,7 +54,7 @@ private: // and retVal is return value or exception. int RunMakeCommand(const char* command, int* retVal, const char* dir, int timeout, - std::ofstream& ofs); + std::ostream& ofs); enum { b_REGULAR_LINE, @@ -113,7 +113,7 @@ private: typedef std::deque<char> t_BuildProcessingQueueType; void ProcessBuffer(const char* data, int length, size_t& tick, - size_t tick_len, std::ofstream& ofs, t_BuildProcessingQueueType* queue); + size_t tick_len, std::ostream& ofs, t_BuildProcessingQueueType* queue); int ProcessSingleLine(const char* data); t_BuildProcessingQueueType BuildProcessingQueue; diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index 7269507..17dbb55 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -16,6 +16,7 @@ #include "cmXMLSafe.h" #include <cmsys/RegularExpression.hxx> +#include <cmsys/FStream.hxx> //---------------------------------------------------------------------------- cmCTestCVS::cmCTestCVS(cmCTest* ct, std::ostream& log): cmCTestVC(ct, log) @@ -231,7 +232,7 @@ std::string cmCTestCVS::ComputeBranchFlag(std::string const& dir) // Lookup the branch in the tag file, if any. std::string tagLine; - std::ifstream tagStream(tagFile.c_str()); + cmsys::ifstream tagStream(tagFile.c_str()); if(tagStream && cmSystemTools::GetLineFromStream(tagStream, tagLine) && tagLine.size() > 1 && tagLine[0] == 'T') { diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 33b084e..3c65c55 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -26,6 +26,7 @@ #include <cmsys/Glob.hxx> #include <cmsys/stl/iterator> #include <cmsys/stl/algorithm> +#include <cmsys/FStream.hxx> #include <stdlib.h> #include <math.h> @@ -511,7 +512,7 @@ int cmCTestCoverageHandler::ProcessHandler() << "\" FullPath=\"" << cmXMLSafe(shortFileName) << "\">\n" << "\t\t<Report>" << std::endl; - std::ifstream ifs(fullFileName.c_str()); + cmsys::ifstream ifs(fullFileName.c_str()); if ( !ifs) { cmOStringStream ostr; @@ -600,7 +601,7 @@ int cmCTestCoverageHandler::ProcessHandler() << "\" FullPath=\"" << cmXMLSafe(*i) << "\">\n" << "\t\t<Report>" << std::endl; - std::ifstream ifs(fullPath.c_str()); + cmsys::ifstream ifs(fullPath.c_str()); if (!ifs) { cmOStringStream ostr; @@ -1158,7 +1159,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " in gcovFile: " << gcovFile << std::endl); - std::ifstream ifile(gcovFile.c_str()); + cmsys::ifstream ifile(gcovFile.c_str()); if ( ! ifile ) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: " @@ -1370,7 +1371,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( = &cont->TotalCoverage[actualSourceFile]; cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " in file: " << fileIt->c_str() << std::endl); - std::ifstream ifile(fileIt->c_str()); + cmsys::ifstream ifile(fileIt->c_str()); if ( ! ifile ) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: " @@ -1530,7 +1531,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( "covbr output in " << outputFile << std::endl); // open the output file - std::ifstream fin(outputFile.c_str()); + cmsys::ifstream fin(outputFile.c_str()); if(!fin) { cmCTestLog(this->CTest, ERROR_MESSAGE, @@ -1743,7 +1744,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( std::vector<std::string> coveredFiles; std::vector<std::string> coveredFilesFullPath; // Read and parse the summary output file - std::ifstream fin(outputFile.c_str()); + cmsys::ifstream fin(outputFile.c_str()); if(!fin) { cmCTestLog(this->CTest, ERROR_MESSAGE, @@ -2012,7 +2013,7 @@ void cmCTestCoverageHandler::LoadLabels() fileList += "/TargetDirectories.txt"; cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " target directory list [" << fileList << "]\n"); - std::ifstream finList(fileList.c_str()); + cmsys::ifstream finList(fileList.c_str()); std::string line; while(cmSystemTools::GetLineFromStream(finList, line)) { @@ -2026,7 +2027,7 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir) LabelSet& dirLabels = this->TargetDirs[dir]; std::string fname = dir; fname += "/Labels.txt"; - std::ifstream fin(fname.c_str()); + cmsys::ifstream fin(fname.c_str()); if(!fin) { return; @@ -2080,7 +2081,7 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir) } //---------------------------------------------------------------------- -void cmCTestCoverageHandler::WriteXMLLabels(std::ofstream& os, +void cmCTestCoverageHandler::WriteXMLLabels(std::ostream& os, std::string const& source) { LabelMapType::const_iterator li = this->SourceLabels.find(source); diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h index 3506928..660f501 100644 --- a/Source/CTest/cmCTestCoverageHandler.h +++ b/Source/CTest/cmCTestCoverageHandler.h @@ -132,7 +132,7 @@ private: // Label reading and writing methods. void LoadLabels(); void LoadLabels(const char* dir); - void WriteXMLLabels(std::ofstream& os, std::string const& source); + void WriteXMLLabels(std::ostream& os, std::string const& source); // Label-based filtering. std::set<int> LabelFilter; diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 725f613..0e0e797 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -18,6 +18,7 @@ #include <cmsys/RegularExpression.hxx> #include <cmsys/ios/sstream> #include <cmsys/Process.h> +#include <cmsys/FStream.hxx> #include <sys/types.h> #include <time.h> @@ -200,7 +201,7 @@ bool cmCTestGIT::UpdateByFetchAndReset() std::string sha1; { std::string fetch_head = this->FindGitDir() + "/FETCH_HEAD"; - std::ifstream fin(fetch_head.c_str(), std::ios::in | std::ios::binary); + cmsys::ifstream fin(fetch_head.c_str(), std::ios::in | std::ios::binary); if(!fin) { this->Log << "Unable to open " << fetch_head << "\n"; diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 8e5fd78..7d9c034 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -19,6 +19,7 @@ #include <cmsys/MD5.h> #include <cmsys/Process.h> #include <cmsys/RegularExpression.hxx> +#include <cmsys/FStream.hxx> //---------------------------------------------------------------------------- cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv) @@ -171,7 +172,7 @@ void cmCTestLaunch::HandleRealArg(const char* arg) // Expand response file arguments. if(arg[0] == '@' && cmSystemTools::FileExists(arg+1)) { - std::ifstream fin(arg+1); + cmsys::ifstream fin(arg+1); std::string line; while(cmSystemTools::GetLineFromStream(fin, line)) { @@ -241,8 +242,8 @@ void cmCTestLaunch::RunChild() cmsysProcess* cp = this->Process; cmsysProcess_SetCommand(cp, this->RealArgV); - std::ofstream fout; - std::ofstream ferr; + cmsys::ofstream fout; + cmsys::ofstream ferr; if(this->Passthru) { // In passthru mode we just share the output pipes. @@ -330,7 +331,7 @@ void cmCTestLaunch::LoadLabels() cmSystemTools::ConvertToUnixSlashes(source); // Load the labels file. - std::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary); + cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary); if(!fin) { return; } bool inTarget = true; bool inSource = false; @@ -579,7 +580,7 @@ void cmCTestLaunch::WriteXMLLabels(std::ostream& fxml) void cmCTestLaunch::DumpFileToXML(std::ostream& fxml, std::string const& fname) { - std::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary); + cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary); std::string line; const char* sep = ""; @@ -652,7 +653,7 @@ cmCTestLaunch fname += "Custom"; fname += purpose; fname += ".txt"; - std::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary); + cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary); std::string line; cmsys::RegularExpression rex; while(cmSystemTools::GetLineFromStream(fin, line)) @@ -671,7 +672,7 @@ bool cmCTestLaunch::ScrapeLog(std::string const& fname) // Look for log file lines matching warning expressions but not // suppression expressions. - std::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary); + cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary); std::string line; while(cmSystemTools::GetLineFromStream(fin, line)) { diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 3ae2ac6..fdce04d 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -18,6 +18,7 @@ #include <cmsys/Process.h> #include <cmsys/RegularExpression.hxx> #include <cmsys/Base64.h> +#include <cmsys/FStream.hxx> #include "cmMakefile.h" #include "cmXMLSafe.h" @@ -929,7 +930,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res, } // put a scope around this to close ifs so the file can be removed { - std::ifstream ifs(ofile.c_str()); + cmsys::ifstream ifs(ofile.c_str()); if ( !ifs ) { std::string log = "Cannot read memory tester output file: " + ofile; @@ -984,7 +985,7 @@ cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res, { return; } - std::ifstream ifs(ofile.c_str()); + cmsys::ifstream ifs(ofile.c_str()); if ( !ifs ) { std::string log = "Cannot read memory tester output file: " + ofile; diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 729f14a..ddd1707 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -17,6 +17,7 @@ #include <stdlib.h> #include <stack> #include <float.h> +#include <cmsys/FStream.hxx> class TestComparator { @@ -325,7 +326,7 @@ void cmCTestMultiProcessHandler::UpdateCostData() if(cmSystemTools::FileExists(fname.c_str())) { - std::ifstream fin; + cmsys::ifstream fin; fin.open(fname.c_str()); std::string line; @@ -384,7 +385,7 @@ void cmCTestMultiProcessHandler::ReadCostData() if(cmSystemTools::FileExists(fname.c_str(), true)) { - std::ifstream fin; + cmsys::ifstream fin; fin.open(fname.c_str()); std::string line; while(std::getline(fin, line)) @@ -721,7 +722,7 @@ void cmCTestMultiProcessHandler::CheckResume() << "----------------------------------------------------------" << std::endl; - std::ifstream fin; + cmsys::ifstream fin; fin.open(fname.c_str()); std::string line; while(std::getline(fin, line)) diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 941d348..139f515 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -235,7 +235,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix, return false; } - ftpfile = ::fopen(local_file.c_str(), "rb"); + ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); *this->LogFile << "\tUpload file: " << local_file.c_str() << " to " << upload_as.c_str() << std::endl; cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " @@ -476,7 +476,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, return false; } - ftpfile = ::fopen(local_file.c_str(), "rb"); + ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " << local_file.c_str() << " to " << upload_as.c_str() << " Size: " << st.st_size << std::endl); @@ -566,7 +566,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, << count << std::endl); ::fclose(ftpfile); - ftpfile = ::fopen(local_file.c_str(), "rb"); + ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); ::curl_easy_setopt(curl, CURLOPT_INFILE, ftpfile); chunk.clear(); @@ -998,7 +998,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix, return false; } size_t fileSize = static_cast<size_t>(st.st_size); - FILE* fp = fopen(local_file.c_str(), "rb"); + FILE* fp = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); if ( !fp ) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot open file: " diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index da24ae4..26f8014 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -21,6 +21,7 @@ #include <cmsys/RegularExpression.hxx> #include <cmsys/Base64.h> #include <cmsys/Directory.hxx> +#include <cmsys/FStream.hxx> #include "cmMakefile.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -931,7 +932,7 @@ void cmCTestTestHandler::UpdateMaxTestNameWidth() bool cmCTestTestHandler::GetValue(const char* tag, int& value, - std::ifstream& fin) + std::istream& fin) { std::string line; bool ret = true; @@ -953,7 +954,7 @@ bool cmCTestTestHandler::GetValue(const char* tag, bool cmCTestTestHandler::GetValue(const char* tag, double& value, - std::ifstream& fin) + std::istream& fin) { std::string line; cmSystemTools::GetLineFromStream(fin, line); @@ -975,7 +976,7 @@ bool cmCTestTestHandler::GetValue(const char* tag, bool cmCTestTestHandler::GetValue(const char* tag, bool& value, - std::ifstream& fin) + std::istream& fin) { std::string line; cmSystemTools::GetLineFromStream(fin, line); @@ -1007,7 +1008,7 @@ bool cmCTestTestHandler::GetValue(const char* tag, bool cmCTestTestHandler::GetValue(const char* tag, size_t& value, - std::ifstream& fin) + std::istream& fin) { std::string line; cmSystemTools::GetLineFromStream(fin, line); @@ -1029,7 +1030,7 @@ bool cmCTestTestHandler::GetValue(const char* tag, bool cmCTestTestHandler::GetValue(const char* tag, std::string& value, - std::ifstream& fin) + std::istream& fin) { std::string line; cmSystemTools::GetLineFromStream(fin, line); @@ -1798,7 +1799,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() } // parse the list of tests to rerun from LastTestsFailed.log - std::ifstream ifs(lastTestsFailedLog.c_str()); + cmsys::ifstream ifs(lastTestsFailedLog.c_str()); if ( ifs ) { std::string line; @@ -1964,7 +1965,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages( } else { - std::ifstream ifs(filename.c_str(), std::ios::in + cmsys::ifstream ifs(filename.c_str(), std::ios::in #ifdef _WIN32 | std::ios::binary #endif @@ -2054,7 +2055,7 @@ void cmCTestTestHandler::SetTestsToRunInformation(const char* in) // string if(cmSystemTools::FileExists(in)) { - std::ifstream fin(in); + cmsys::ifstream fin(in); unsigned long filelen = cmSystemTools::FileLength(in); char* buff = new char[filelen+1]; fin.getline(buff, filelen); diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 398f052..6dda300 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -227,19 +227,19 @@ private: bool GetValue(const char* tag, std::string& value, - std::ifstream& fin); + std::istream& fin); bool GetValue(const char* tag, int& value, - std::ifstream& fin); + std::istream& fin); bool GetValue(const char* tag, size_t& value, - std::ifstream& fin); + std::istream& fin); bool GetValue(const char* tag, bool& value, - std::ifstream& fin); + std::istream& fin); bool GetValue(const char* tag, double& value, - std::ifstream& fin); + std::istream& fin); /** * Find the executable for a test */ diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx index 137f344..85e07ae 100644 --- a/Source/CTest/cmParseCacheCoverage.cxx +++ b/Source/CTest/cmParseCacheCoverage.cxx @@ -5,6 +5,7 @@ #include "cmParseCacheCoverage.h" #include <cmsys/Directory.hxx> #include <cmsys/Glob.hxx> +#include <cmsys/FStream.hxx> cmParseCacheCoverage::cmParseCacheCoverage( @@ -106,7 +107,7 @@ bool cmParseCacheCoverage::SplitString(std::vector<std::string>& args, bool cmParseCacheCoverage::ReadCMCovFile(const char* file) { - std::ifstream in(file); + cmsys::ifstream in(file); if(!in) { cmCTestLog(this->CTest, ERROR_MESSAGE, diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index 6b4adb4..528d0db 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -5,6 +5,7 @@ #include "cmParseGTMCoverage.h" #include <cmsys/Directory.hxx> #include <cmsys/Glob.hxx> +#include <cmsys/FStream.hxx> cmParseGTMCoverage::cmParseGTMCoverage(cmCTestCoverageHandlerContainer& cont, @@ -48,7 +49,7 @@ bool cmParseGTMCoverage::LoadCoverageData(const char* d) bool cmParseGTMCoverage::ReadMCovFile(const char* file) { - std::ifstream in(file); + cmsys::ifstream in(file); if(!in) { return false; @@ -127,7 +128,7 @@ bool cmParseGTMCoverage::FindFunctionInMumpsFile(std::string const& filepath, std::string const& function, int& lineoffset) { - std::ifstream in(filepath.c_str()); + cmsys::ifstream in(filepath.c_str()); if(!in) { return false; diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx index 37e8bd0..6226feb 100644 --- a/Source/CTest/cmParseMumpsCoverage.cxx +++ b/Source/CTest/cmParseMumpsCoverage.cxx @@ -5,6 +5,7 @@ #include "cmParseGTMCoverage.h" #include <cmsys/Directory.hxx> #include <cmsys/Glob.hxx> +#include <cmsys/FStream.hxx> cmParseMumpsCoverage::cmParseMumpsCoverage( @@ -23,7 +24,7 @@ bool cmParseMumpsCoverage::ReadCoverageFile(const char* file) // Read the gtm_coverage.mcov file, that has two lines of data: // packages:/full/path/to/Vista/Packages // coverage_dir:/full/path/to/dir/with/*.mcov - std::ifstream in(file); + cmsys::ifstream in(file); if(!in) { return false; @@ -61,7 +62,7 @@ bool cmParseMumpsCoverage::ReadCoverageFile(const char* file) void cmParseMumpsCoverage::InitializeMumpsFile(std::string& file) { // initialize the coverage information for a given mumps file - std::ifstream in(file.c_str()); + cmsys::ifstream in(file.c_str()); if(!in) { return; diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx index 593b2d1..1c26c1c 100644 --- a/Source/CTest/cmParsePHPCoverage.cxx +++ b/Source/CTest/cmParsePHPCoverage.cxx @@ -2,6 +2,7 @@ #include "cmSystemTools.h" #include "cmParsePHPCoverage.h" #include <cmsys/Directory.hxx> +#include <cmsys/FStream.hxx> /* To setup coverage for php. @@ -20,7 +21,7 @@ cmParsePHPCoverage::cmParsePHPCoverage(cmCTestCoverageHandlerContainer& cont, { } -bool cmParsePHPCoverage::ReadUntil(std::ifstream& in, char until) +bool cmParsePHPCoverage::ReadUntil(std::istream& in, char until) { char c = 0; while(in.get(c) && c != until) @@ -32,7 +33,7 @@ bool cmParsePHPCoverage::ReadUntil(std::ifstream& in, char until) } return true; } -bool cmParsePHPCoverage::ReadCoverageArray(std::ifstream& in, +bool cmParsePHPCoverage::ReadCoverageArray(std::istream& in, cmStdString const& fileName) { cmCTestCoverageHandlerContainer::SingleFileCoverageVector& coverageVector @@ -109,7 +110,7 @@ bool cmParsePHPCoverage::ReadCoverageArray(std::ifstream& in, return true; } -bool cmParsePHPCoverage::ReadInt(std::ifstream& in, int& v) +bool cmParsePHPCoverage::ReadInt(std::istream& in, int& v) { std::string s; char c = 0; @@ -121,7 +122,7 @@ bool cmParsePHPCoverage::ReadInt(std::ifstream& in, int& v) return true; } -bool cmParsePHPCoverage::ReadArraySize(std::ifstream& in, int& size) +bool cmParsePHPCoverage::ReadArraySize(std::istream& in, int& size) { char c = 0; in.get(c); @@ -139,7 +140,7 @@ bool cmParsePHPCoverage::ReadArraySize(std::ifstream& in, int& size) return false; } -bool cmParsePHPCoverage::ReadFileInformation(std::ifstream& in) +bool cmParsePHPCoverage::ReadFileInformation(std::istream& in) { char buf[4]; in.read(buf, 2); @@ -190,7 +191,7 @@ bool cmParsePHPCoverage::ReadFileInformation(std::ifstream& in) bool cmParsePHPCoverage::ReadPHPData(const char* file) { - std::ifstream in(file); + cmsys::ifstream in(file); if(!in) { return false; diff --git a/Source/CTest/cmParsePHPCoverage.h b/Source/CTest/cmParsePHPCoverage.h index d50a83c..035a093 100644 --- a/Source/CTest/cmParsePHPCoverage.h +++ b/Source/CTest/cmParsePHPCoverage.h @@ -32,11 +32,11 @@ public: void PrintCoverage(); private: bool ReadPHPData(const char* file); - bool ReadArraySize(std::ifstream& in, int& size); - bool ReadFileInformation(std::ifstream& in); - bool ReadInt(std::ifstream& in, int& v); - bool ReadCoverageArray(std::ifstream& in, cmStdString const&); - bool ReadUntil(std::ifstream& in, char until); + bool ReadArraySize(std::istream& in, int& size); + bool ReadFileInformation(std::istream& in); + bool ReadInt(std::istream& in, int& v); + bool ReadCoverageArray(std::istream& in, cmStdString const&); + bool ReadUntil(std::istream& in, char until); cmCTestCoverageHandlerContainer& Coverage; cmCTest* CTest; }; diff --git a/Source/CTest/cmParsePythonCoverage.cxx b/Source/CTest/cmParsePythonCoverage.cxx index a086f13..38a770a 100644 --- a/Source/CTest/cmParsePythonCoverage.cxx +++ b/Source/CTest/cmParsePythonCoverage.cxx @@ -3,7 +3,7 @@ #include "cmXMLParser.h" #include "cmParsePythonCoverage.h" #include <cmsys/Directory.hxx> - +#include <cmsys/FStream.hxx> //---------------------------------------------------------------------------- class cmParsePythonCoverage::XMLParser: public cmXMLParser @@ -35,7 +35,7 @@ protected: atts[tagCount+1]; FileLinesType& curFileLines = this->Coverage.TotalCoverage[this->CurFileName]; - std::ifstream fin(this->CurFileName.c_str()); + cmsys::ifstream fin(this->CurFileName.c_str()); if(!fin) { cmCTestLog(this->CTest, ERROR_MESSAGE, |