Commit cc1139cc authored by Nils Gladitz's avatar Nils Gladitz

strings: Remove redundant calls to std::string::c_str()

Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
parent 1b3495d3
......@@ -56,7 +56,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
localToplevel += "/"+ component->Name;
std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
// Change to local toplevel
cmSystemTools::ChangeDirectory(localToplevel.c_str());
cmSystemTools::ChangeDirectory(localToplevel);
std::string filePrefix;
if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
{
......@@ -80,7 +80,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
}
}
// Go back to previous dir
cmSystemTools::ChangeDirectory(dir.c_str());
cmSystemTools::ChangeDirectory(dir);
return 1;
}
......@@ -270,7 +270,7 @@ int cmCPackArchiveGenerator::PackageFiles()
DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive);
std::vector<std::string>::const_iterator fileIt;
std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(toplevel.c_str());
cmSystemTools::ChangeDirectory(toplevel);
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
{
// Get the relative path to the file
......@@ -288,7 +288,7 @@ int cmCPackArchiveGenerator::PackageFiles()
return 0;
}
}
cmSystemTools::ChangeDirectory(dir.c_str());
cmSystemTools::ChangeDirectory(dir);
// The destructor of cmArchiveWrite will close and finish the write
return 1;
}
......
......@@ -58,7 +58,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel,
// Begin the archive for this pack
std::string localToplevel(initialTopLevel);
std::string packageFileName(
cmSystemTools::GetParentDirectory(toplevel.c_str())
cmSystemTools::GetParentDirectory(toplevel)
);
std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
......@@ -186,7 +186,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne()
// The ALL GROUPS in ONE package case
std::string localToplevel(initialTopLevel);
std::string packageFileName(
cmSystemTools::GetParentDirectory(toplevel.c_str())
cmSystemTools::GetParentDirectory(toplevel)
);
std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
......@@ -540,7 +540,7 @@ int cmCPackDebGenerator::createDeb()
localcopy += filenamename;
// if we can copy the file, it means it does exist, let's add it:
if( cmsys::SystemTools::CopyFileIfDifferent(
i->c_str(), localcopy.c_str()) )
*i, localcopy) )
{
// debian is picky and need relative to ./ path in the tar.*
cmd += " ./";
......
......@@ -399,7 +399,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: "
<< inFile << " -> " << filePath << std::endl);
/* If the file is a symlink we will have to re-create it */
if ( cmSystemTools::FileIsSymlink(inFile.c_str()))
if ( cmSystemTools::FileIsSymlink(inFile))
{
std::string targetFile;
std::string inFileRelative =
......@@ -429,7 +429,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
goToDir += "/"+subdir;
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Change dir to: " << goToDir <<std::endl);
cmSystemTools::ChangeDirectory(goToDir.c_str());
cmSystemTools::ChangeDirectory(goToDir);
for (symlinkedIt=symlinkedFiles.begin();
symlinkedIt != symlinkedFiles.end();
++symlinkedIt)
......@@ -448,7 +448,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Going back to: "
<< curDir <<std::endl);
cmSystemTools::ChangeDirectory(curDir.c_str());
cmSystemTools::ChangeDirectory(curDir);
}
}
}
......
......@@ -657,8 +657,8 @@ bool cmCPackNSISGenerator::GetListOfSubdirectories(const char* topdir,
cmsys_stl::string fullPath = topdir;
fullPath += "/";
fullPath += dir.GetFile(static_cast<unsigned long>(fileNum));
if(cmsys::SystemTools::FileIsDirectory(fullPath.c_str()) &&
!cmsys::SystemTools::FileIsSymlink(fullPath.c_str()))
if(cmsys::SystemTools::FileIsDirectory(fullPath) &&
!cmsys::SystemTools::FileIsSymlink(fullPath))
{
if (!this->GetListOfSubdirectories(fullPath.c_str(), dirs))
{
......@@ -771,7 +771,7 @@ CreateComponentDescription(cmCPackComponent *component,
<< archiveFile << std::endl);
if (cmSystemTools::FileExists(archiveFile.c_str(), true))
{
if (!cmSystemTools::RemoveFile(archiveFile.c_str()))
if (!cmSystemTools::RemoveFile(archiveFile))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Unable to remove archive file " << archiveFile
......
......@@ -57,7 +57,7 @@ int cmCPackRPMGenerator::PackageOnePack(std::string initialToplevel,
// Begin the archive for this pack
std::string localToplevel(initialToplevel);
std::string packageFileName(
cmSystemTools::GetParentDirectory(toplevel.c_str())
cmSystemTools::GetParentDirectory(toplevel)
);
std::string outputFileName(
GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
......@@ -166,7 +166,7 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne()
// The ALL GROUPS in ONE package case
std::string localToplevel(initialTopLevel);
std::string packageFileName(
cmSystemTools::GetParentDirectory(toplevel.c_str())
cmSystemTools::GetParentDirectory(toplevel)
);
std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
......
......@@ -267,7 +267,7 @@ int main (int argc, char const* const* argv)
if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) )
{
cpackConfigFile =
cmSystemTools::CollapseFullPath(cpackConfigFile.c_str());
cmSystemTools::CollapseFullPath(cpackConfigFile);
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack configuration file: " << cpackConfigFile
<< std::endl);
......
......@@ -109,7 +109,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
out << "Error: cmake execution failed\n";
out << cmakeOutString << "\n";
// return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str());
cmSystemTools::ChangeDirectory(cwd);
if(outstring)
{
*outstring = out.str();
......@@ -128,7 +128,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
out << "Error: cmake execution failed\n";
out << cmakeOutString << "\n";
// return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str());
cmSystemTools::ChangeDirectory(cwd);
if(outstring)
{
*outstring = out.str();
......@@ -241,11 +241,11 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
out << "Internal cmake changing into directory: "
<< this->BinaryDir << std::endl;
if (!cmSystemTools::FileIsDirectory(this->BinaryDir.c_str()))
if (!cmSystemTools::FileIsDirectory(this->BinaryDir))
{
cmSystemTools::MakeDirectory(this->BinaryDir.c_str());
}
cmSystemTools::ChangeDirectory(this->BinaryDir.c_str());
cmSystemTools::ChangeDirectory(this->BinaryDir);
if(this->BuildNoCMake)
{
......@@ -374,7 +374,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
cmCTestLog(this->CTest, ERROR_MESSAGE, out.str());
}
// return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str());
cmSystemTools::ChangeDirectory(cwd);
return 1;
}
......@@ -391,7 +391,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
if(this->BuildRunDir.size())
{
out << "Run test in directory: " << this->BuildRunDir << "\n";
cmSystemTools::ChangeDirectory(this->BuildRunDir.c_str());
cmSystemTools::ChangeDirectory(this->BuildRunDir);
}
out << "Running test command: \"" << fullPath << "\"";
for(size_t k=0; k < this->TestCommandArgs.size(); ++k)
......@@ -453,9 +453,9 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
// dir must exist before CollapseFullPath is called
cmSystemTools::MakeDirectory(this->BinaryDir.c_str());
this->BinaryDir
= cmSystemTools::CollapseFullPath(this->BinaryDir.c_str());
= cmSystemTools::CollapseFullPath(this->BinaryDir);
this->SourceDir
= cmSystemTools::CollapseFullPath(this->SourceDir.c_str());
= cmSystemTools::CollapseFullPath(this->SourceDir);
}
else
{
......
......@@ -610,7 +610,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os)
int numWarningsAllowed = this->MaxWarnings;
// Identify fragments on disk.
cmsys::Directory launchDir;
launchDir.Load(this->CTestLaunchDir.c_str());
launchDir.Load(this->CTestLaunchDir);
unsigned long n = launchDir.GetNumberOfFiles();
for(unsigned long i=0; i < n; ++i)
{
......@@ -649,7 +649,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os)
std::string srcdir = this->CTest->GetCTestConfiguration("SourceDirectory");
// make sure the source dir is in the correct case on windows
// via a call to collapse full path.
srcdir = cmSystemTools::CollapseFullPath(srcdir.c_str());
srcdir = cmSystemTools::CollapseFullPath(srcdir);
srcdir += "/";
for ( it = ew.begin();
it != ew.end() && (numErrorsAllowed || numWarningsAllowed); it++ )
......@@ -695,7 +695,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os)
{
// make sure it is a full path with the correct case
cm->SourceFile = cmSystemTools::CollapseFullPath(
cm->SourceFile.c_str());
cm->SourceFile);
cmSystemTools::ReplaceString(
cm->SourceFile, srcdir.c_str(), "");
}
......@@ -822,7 +822,7 @@ cmCTestBuildHandler::LaunchHelper::LaunchHelper(cmCTestBuildHandler* handler):
launchDir += "/Build";
// Clean out any existing launcher fragments.
cmSystemTools::RemoveADirectory(launchDir.c_str());
cmSystemTools::RemoveADirectory(launchDir);
if(this->Handler->UseCTestLaunch)
{
......
......@@ -164,7 +164,7 @@ void cmCTestCoverageHandler::CleanCoverageLogFiles(std::ostream& log)
fi != files.end(); ++fi)
{
log << "Removing old coverage log: " << *fi << "\n";
cmSystemTools::RemoveFile(fi->c_str());
cmSystemTools::RemoveFile(*fi);
}
}
......@@ -237,10 +237,10 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
std::string fSrcDir = cmSystemTools::CollapseFullPath(srcDir);
std::string fBinDir = cmSystemTools::CollapseFullPath(binDir);
std::string fFile = cmSystemTools::CollapseFullPath(file);
bool sourceSubDir = cmSystemTools::IsSubDirectory(fFile.c_str(),
fSrcDir.c_str());
bool buildSubDir = cmSystemTools::IsSubDirectory(fFile.c_str(),
fBinDir.c_str());
bool sourceSubDir = cmSystemTools::IsSubDirectory(fFile,
fSrcDir);
bool buildSubDir = cmSystemTools::IsSubDirectory(fFile,
fBinDir);
// Always check parent directory of the file.
std::string fileDir = cmSystemTools::GetFilenamePath(fFile);
std::string checkDir;
......@@ -758,8 +758,8 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
//----------------------------------------------------------------------
bool IsFileInDir(const std::string &infile, const std::string &indir)
{
std::string file = cmSystemTools::CollapseFullPath(infile.c_str());
std::string dir = cmSystemTools::CollapseFullPath(indir.c_str());
std::string file = cmSystemTools::CollapseFullPath(infile);
std::string dir = cmSystemTools::CollapseFullPath(indir);
if (
file.size() > dir.size() &&
......@@ -779,7 +779,7 @@ int cmCTestCoverageHandler::HandlePHPCoverage(
{
cmParsePHPCoverage cov(*cont, this->CTest);
std::string coverageDir = this->CTest->GetBinaryDir() + "/xdebugCoverage";
if(cmSystemTools::FileIsDirectory(coverageDir.c_str()))
if(cmSystemTools::FileIsDirectory(coverageDir))
{
cov.ReadPHPCoverageDirectory(coverageDir.c_str());
}
......@@ -974,7 +974,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
std::string tempDir = testingDir + "/CoverageInfo";
std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::MakeDirectory(tempDir.c_str());
cmSystemTools::ChangeDirectory(tempDir.c_str());
cmSystemTools::ChangeDirectory(tempDir);
int gcovStyle = 0;
......@@ -1295,7 +1295,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
*cont->OFS << " produced in source dir: " << sourceFile
<< std::endl;
actualSourceFile
= cmSystemTools::CollapseFullPath(sourceFile.c_str());
= cmSystemTools::CollapseFullPath(sourceFile);
}
else if ( IsFileInDir(sourceFile, cont->BinaryDir) )
{
......@@ -1304,7 +1304,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
*cont->OFS << " produced in binary dir: " << sourceFile
<< std::endl;
actualSourceFile
= cmSystemTools::CollapseFullPath(sourceFile.c_str());
= cmSystemTools::CollapseFullPath(sourceFile);
}
if ( actualSourceFile.empty() )
......@@ -1345,7 +1345,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
}
}
cmSystemTools::ChangeDirectory(currentDirectory.c_str());
cmSystemTools::ChangeDirectory(currentDirectory);
return file_count;
}
......@@ -1409,8 +1409,8 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
for ( it = files.begin(); it != files.end(); ++ it )
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, "." << std::flush);
std::string fileDir = cmSystemTools::GetFilenamePath(it->c_str());
cmSystemTools::ChangeDirectory(fileDir.c_str());
std::string fileDir = cmSystemTools::GetFilenamePath(*it);
cmSystemTools::ChangeDirectory(fileDir);
std::string command = "\"" + lcovCommand + "\" " +
lcovExtraFlags + " ";
......@@ -1609,7 +1609,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
}
}
cmSystemTools::ChangeDirectory(currentDirectory.c_str());
cmSystemTools::ChangeDirectory(currentDirectory);
return file_count;
}
......@@ -1653,7 +1653,7 @@ void cmCTestCoverageHandler::FindLCovFiles(std::vector<std::string>& files)
gl.RecurseThroughSymlinksOff();
std::string prevBinaryDir;
cmSystemTools::ChangeDirectory(
this->CTest->GetCTestConfiguration("BuildDirectory").c_str());
this->CTest->GetCTestConfiguration("BuildDirectory"));
// Run profmerge to merge all *.dyn files into dpi files
cmSystemTools::RunSingleCommand("profmerge");
......@@ -1696,9 +1696,9 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
std::string tempDir = testingDir + "/CoverageInfo";
std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::MakeDirectory(tempDir.c_str());
cmSystemTools::ChangeDirectory(tempDir.c_str());
cmSystemTools::ChangeDirectory(tempDir);
cmSystemTools::ChangeDirectory(currentDirectory.c_str());
cmSystemTools::ChangeDirectory(currentDirectory);
std::vector<std::string>::iterator fileIt;
int file_count = 0;
......@@ -1714,7 +1714,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
}
std::string actualSourceFile
= cmSystemTools::CollapseFullPath(fileName.c_str());
= cmSystemTools::CollapseFullPath(fileName);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Check coverage for file: " << actualSourceFile
<< std::endl);
......@@ -1802,7 +1802,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
}
++ file_count;
}
cmSystemTools::ChangeDirectory(currentDirectory.c_str());
cmSystemTools::ChangeDirectory(currentDirectory);
return file_count;
}
......@@ -2132,7 +2132,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
file += "/";
file += sourceFile;
}
file = cmSystemTools::CollapseFullPath(file.c_str());
file = cmSystemTools::CollapseFullPath(file);
bool shouldIDoCoverage
= this->ShouldIDoCoverage(file.c_str(),
cont->SourceDir.c_str(),
......
......@@ -158,7 +158,7 @@ std::string cmCTestGIT::FindTopDir()
{
top_dir += "/";
top_dir += cdup;
top_dir = cmSystemTools::CollapseFullPath(top_dir.c_str());
top_dir = cmSystemTools::CollapseFullPath(top_dir);
}
return top_dir;
}
......
......@@ -137,7 +137,7 @@ bool cmCTestHandlerCommand
}
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(
this->CTest->GetCTestConfiguration("BuildDirectory").c_str());
this->CTest->GetCTestConfiguration("BuildDirectory"));
int res = handler->ProcessHandler();
if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE])
{
......@@ -146,7 +146,7 @@ bool cmCTestHandlerCommand
this->Makefile->AddDefinition(
this->Values[ct_RETURN_VALUE], str.str().c_str());
}
cmSystemTools::ChangeDirectory(current_dir.c_str());
cmSystemTools::ChangeDirectory(current_dir);
return true;
}
......
......@@ -48,8 +48,8 @@ cmCTestLaunch::~cmCTestLaunch()
cmsysProcess_Delete(this->Process);
if(!this->Passthru)
{
cmSystemTools::RemoveFile(this->LogOut.c_str());
cmSystemTools::RemoveFile(this->LogErr.c_str());
cmSystemTools::RemoveFile(this->LogOut);
cmSystemTools::RemoveFile(this->LogErr);
}
}
......@@ -434,8 +434,8 @@ void cmCTestLaunch::WriteXMLAction(std::ostream& fxml)
// If file is in source tree use its relative location.
if(cmSystemTools::FileIsFullPath(this->SourceDir.c_str()) &&
cmSystemTools::FileIsFullPath(source.c_str()) &&
cmSystemTools::IsSubDirectory(source.c_str(),
this->SourceDir.c_str()))
cmSystemTools::IsSubDirectory(source,
this->SourceDir))
{
source = cmSystemTools::RelativePath(this->SourceDir.c_str(),
source.c_str());
......
......@@ -1221,10 +1221,10 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
}
}
cmSystemTools::Delay(1000);
cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str());
cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
<< this->BoundsCheckerDPBDFile << std::endl);
cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile.c_str());
cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
<< this->BoundsCheckerXMLFile << std::endl);
}
......@@ -1255,7 +1255,7 @@ cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
}
if(this->LogWithPID)
{
cmSystemTools::RemoveFile(ofile.c_str());
cmSystemTools::RemoveFile(ofile);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "<< ofile <<"\n");
}
}
......
......@@ -123,7 +123,7 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
testRun->SetTestProperties(this->Properties[test]);
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(this->Properties[test]->Directory.c_str());
cmSystemTools::ChangeDirectory(this->Properties[test]->Directory);
// Lock the resources we'll be using
this->LockResources(test);
......@@ -156,7 +156,7 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
this->Failed->push_back(this->Properties[test]->Name);
delete testRun;
}
cmSystemTools::ChangeDirectory(current_dir.c_str());
cmSystemTools::ChangeDirectory(current_dir);
}
//---------------------------------------------------------
......@@ -334,7 +334,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
{
if(line == "---") break;
std::vector<cmsys::String> parts =
cmSystemTools::SplitString(line.c_str(), ' ');
cmSystemTools::SplitString(line, ' ');
//Format: <name> <previous_runs> <avg_cost>
if(parts.size() < 3) break;
......@@ -357,7 +357,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
}
}
fin.close();
cmSystemTools::RemoveFile(fname.c_str());
cmSystemTools::RemoveFile(fname);
}
// Add all tests not previously listed in the file
......@@ -393,7 +393,7 @@ void cmCTestMultiProcessHandler::ReadCostData()
if(line == "---") break;
std::vector<cmsys::String> parts =
cmSystemTools::SplitString(line.c_str(), ' ');
cmSystemTools::SplitString(line, ' ');
// Probably an older version of the file, will be fixed next run
if(parts.size() < 3)
......@@ -621,7 +621,7 @@ void cmCTestMultiProcessHandler::MarkFinished()
{
std::string fname = this->CTest->GetBinaryDir()
+ "/Testing/Temporary/CTestCheckpoint.txt";
cmSystemTools::RemoveFile(fname.c_str());
cmSystemTools::RemoveFile(fname);
}
//---------------------------------------------------------
......@@ -639,7 +639,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
//push working dir
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(p.Directory.c_str());
cmSystemTools::ChangeDirectory(p.Directory);
cmCTestRunTest testRun(this->TestHandler);
testRun.SetIndex(p.Index);
......@@ -676,7 +676,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
cmCTestLog(this->CTest, HANDLER_OUTPUT, p.Name.c_str() << std::endl);
//pop working dir
cmSystemTools::ChangeDirectory(current_dir.c_str());
cmSystemTools::ChangeDirectory(current_dir);
}
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl << "Total Tests: "
......@@ -735,7 +735,7 @@ void cmCTestMultiProcessHandler::CheckResume()
}
else if(cmSystemTools::FileExists(fname.c_str(), true))
{
cmSystemTools::RemoveFile(fname.c_str());
cmSystemTools::RemoveFile(fname);
}
}
......
......@@ -280,12 +280,12 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
// Set the working directory to the tests directory
std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(this->TestProperties->Directory.c_str());
cmSystemTools::ChangeDirectory(this->TestProperties->Directory);
this->DartProcessing();
// restore working directory
cmSystemTools::ChangeDirectory(oldpath.c_str());
cmSystemTools::ChangeDirectory(oldpath);
// if this is doing MemCheck then all the output needs to be put into
......
......@@ -184,7 +184,7 @@ int cmCTestScriptHandler::ProcessHandler()
{
// for each script run it
res += this->RunConfigurationScript
(cmSystemTools::CollapseFullPath(this->ConfigurationScripts[i].c_str()),
(cmSystemTools::CollapseFullPath(this->ConfigurationScripts[i]),
this->ScriptProcessScope[i]);
}
if ( res )
......@@ -482,8 +482,8 @@ int cmCTestScriptHandler::ExtractVariables()
= this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY");
// add in translations for src and bin
cmSystemTools::AddKeepPath(this->SourceDir.c_str());
cmSystemTools::AddKeepPath(this->BinaryDir.c_str());
cmSystemTools::AddKeepPath(this->SourceDir);
cmSystemTools::AddKeepPath(this->BinaryDir);
this->CTestCmd
= this->Makefile->GetSafeDefinition("CTEST_COMMAND");
......@@ -743,11 +743,11 @@ int cmCTestScriptHandler::BackupDirectories()
// if for some reason those directories exist then first delete them
if (cmSystemTools::FileExists(this->BackupSourceDir.c_str()))
{
cmSystemTools::RemoveADirectory(this->BackupSourceDir.c_str());
cmSystemTools::RemoveADirectory(this->BackupSourceDir);
}
if (cmSystemTools::FileExists(this->BackupBinaryDir.c_str()))
{
cmSystemTools::RemoveADirectory(this->BackupBinaryDir.c_str());
cmSystemTools::RemoveADirectory(this->BackupBinaryDir);
}
// first rename the src and binary directories
......@@ -991,8 +991,8 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
// if all was succesful, delete the backup dirs to free up disk space
if (this->Backup)
{
cmSystemTools::RemoveADirectory(this->BackupSourceDir.c_str());
cmSystemTools::RemoveADirectory(this->BackupBinaryDir.c_str());
cmSystemTools::RemoveADirectory(this->BackupSourceDir);
cmSystemTools::RemoveADirectory(this->BackupBinaryDir);
}
return 0;
......@@ -1033,11 +1033,11 @@ void cmCTestScriptHandler::RestoreBackupDirectories()
// if for some reason those directories exist then first delete them
if (cmSystemTools::FileExists(this->SourceDir.c_str()))
{
cmSystemTools::RemoveADirectory(this->SourceDir.c_str());
cmSystemTools::RemoveADirectory(this->SourceDir);
}
if (cmSystemTools::FileExists(this->BinaryDir.c_str()))
{
cmSystemTools::RemoveADirectory(this->BinaryDir.c_str());
cmSystemTools::RemoveADirectory(this->BinaryDir);
}
// rename the src and binary directories
rename(this->BackupSourceDir.c_str(), this->SourceDir.c_str());
......@@ -1100,7 +1100,7 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce(
const std::string& directoryPath)
{
cmsys::Directory directory;
directory.Load(directoryPath.c_str());
directory.Load(directoryPath);
for(unsigned long i = 0; i < directory.GetNumberOfFiles(); ++i)
{
......@@ -1113,26 +1113,26 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce(
std::string fullPath = directoryPath + std::string("/") + path;
bool isDirectory = cmSystemTools::FileIsDirectory(fullPath.c_str()) &&
!cmSystemTools::FileIsSymlink(fullPath.c_str());
bool isDirectory = cmSystemTools::FileIsDirectory(fullPath) &&
!cmSystemTools::FileIsSymlink(fullPath);
if(isDirectory)
{
if(!cmSystemTools::RemoveADirectory(fullPath.c_str()))
if(!cmSystemTools::RemoveADirectory(fullPath))
{
return false;
}
}
else
{
if(!cmSystemTools::RemoveFile(fullPath.c_str()))
if(!cmSystemTools::RemoveFile(fullPath))
{
return false;
}
}
}
return cmSystemTools::RemoveADirectory(directoryPath.c_str());
return cmSystemTools::RemoveADirectory(directoryPath);
}
//-------------------------------------------------------------------------
......
......@@ -124,7 +124,7 @@ bool cmCTestStartCommand
{
return false;
}
if(!cmSystemTools::FileIsDirectory(sourceDir.c_str()))
if(!cmSystemTools::FileIsDirectory(sourceDir))
{
cmOStringStream e;
e << "given source path\n"
......
......@@ -236,7 +236,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
}
unsigned long filelen = cmSystemTools::FileLength(local_file.c_str());
ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
*this->LogFile << "\tUpload file: " << local_file << " to "
<< upload_as << std::endl;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "
......@@ -477,7 +477,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
}
unsigned long filelen = cmSystemTools::FileLength(local_file.c_str());
ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "
<< local_file << " to "
<< upload_as << " Size: " << filelen << std::endl);
......@@ -567,7 +567,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
<< count << std::endl);
::fclose(ftpfile);
ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");