Refactor: Use cmStrCat to construct error strings

Replace string construction using std::stringstream with cmStrCat and
cmWrap.
This commit is contained in:
Asit Dhal
2019-09-15 19:11:02 +02:00
committed by Brad King
parent 1423507a71
commit 9dba84cfa5
31 changed files with 545 additions and 797 deletions
+3 -9
View File
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmConfigureFileCommand.h"
#include <sstream>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
@@ -26,13 +24,9 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args,
// If the input location is a directory, error out.
if (cmSystemTools::FileIsDirectory(inputFile)) {
std::ostringstream e;
/* clang-format off */
e << "input location\n"
<< " " << inputFile << "\n"
<< "is a directory but a file was expected.";
/* clang-format on */
status.SetError(e.str());
status.SetError(cmStrCat("input location\n ", inputFile,
"\n"
"is a directory but a file was expected."));
return false;
}