diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2018-01-31 15:20:02 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2018-01-31 15:23:03 (GMT) |
commit | 653b894683abe63233cb8679b34ea39d9017e317 (patch) | |
tree | 200e5066b754d8ddfdc7beb86c4db179aa2e69d0 /Source/CPack/cmCPackNSISGenerator.cxx | |
parent | 4499cc8bb65e217e1cb2959452ed391af82e757b (diff) | |
download | CMake-653b894683abe63233cb8679b34ea39d9017e317.zip CMake-653b894683abe63233cb8679b34ea39d9017e317.tar.gz CMake-653b894683abe63233cb8679b34ea39d9017e317.tar.bz2 |
Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
`const char*` in the following classes: `cmMakeFile`, `cmake`,
`cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator`
and a few others.
* Greatly reduce using of `const char*` overloads for
`cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
Diffstat (limited to 'Source/CPack/cmCPackNSISGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index ef2add3..3f7164a 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -62,8 +62,7 @@ int cmCPackNSISGenerator::PackageFiles() std::ostringstream str; for (std::string const& file : files) { std::string outputDir = "$INSTDIR"; - std::string fileN = - cmSystemTools::RelativePath(toplevel.c_str(), file.c_str()); + std::string fileN = cmSystemTools::RelativePath(toplevel, file); if (!this->Components.empty()) { const std::string::size_type pos = fileN.find('/'); @@ -90,8 +89,7 @@ int cmCPackNSISGenerator::PackageFiles() std::ostringstream dstr; for (std::string const& dir : dirs) { std::string componentName; - std::string fileN = - cmSystemTools::RelativePath(toplevel.c_str(), dir.c_str()); + std::string fileN = cmSystemTools::RelativePath(toplevel, dir); if (fileN.empty()) { continue; } @@ -669,8 +667,8 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( uploadDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY"); uploadDirectory += "/CPackUploads"; } - if (!cmSystemTools::FileExists(uploadDirectory.c_str())) { - if (!cmSystemTools::MakeDirectory(uploadDirectory.c_str())) { + if (!cmSystemTools::FileExists(uploadDirectory)) { + if (!cmSystemTools::MakeDirectory(uploadDirectory)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Unable to create NSIS upload directory " << uploadDirectory << std::endl); @@ -683,7 +681,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Building downloaded component archive: " << archiveFile << std::endl); - if (cmSystemTools::FileExists(archiveFile.c_str(), true)) { + if (cmSystemTools::FileExists(archiveFile, true)) { if (!cmSystemTools::RemoveFile(archiveFile)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Unable to remove archive file " << archiveFile << std::endl); |