diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-07-27 18:35:46 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-07-28 00:00:59 (GMT) |
commit | 809248a0c9f3c2c203399d4cefe10a23cfc53add (patch) | |
tree | ad89e2f35014818ec4260bad1d9f85176c5df56c /Source/CPack/WiX | |
parent | 7137b1783549fb33fcc09eabdd0d77511d36c23b (diff) | |
download | CMake-809248a0c9f3c2c203399d4cefe10a23cfc53add.zip CMake-809248a0c9f3c2c203399d4cefe10a23cfc53add.tar.gz CMake-809248a0c9f3c2c203399d4cefe10a23cfc53add.tar.bz2 |
strings: use character literals where possible
Diffstat (limited to 'Source/CPack/WiX')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 30 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXAccessControlList.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXPatch.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXPatchParser.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXSourceWriter.cxx | 28 |
6 files changed, 37 insertions, 37 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index e9138ee..9530120 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -113,12 +113,12 @@ bool cmCPackWIXGenerator::RunCandleCommand(std::string const& sourceFile, } if (!cmHasSuffix(sourceFile, this->CPackTopLevel)) { - command << " " << QuotePath(cmStrCat("-I", this->CPackTopLevel)); + command << ' ' << QuotePath(cmStrCat("-I", this->CPackTopLevel)); } AddCustomFlags("CPACK_WIX_CANDLE_EXTRA_FLAGS", command); - command << " " << QuotePath(sourceFile); + command << ' ' << QuotePath(sourceFile); return RunWiXCommand(command.str()); } @@ -147,7 +147,7 @@ bool cmCPackWIXGenerator::RunLightCommand(std::string const& objectFiles) AddCustomFlags("CPACK_WIX_LIGHT_EXTRA_FLAGS", command); - command << " " << objectFiles; + command << ' ' << objectFiles; return RunWiXCommand(command.str()); } @@ -296,14 +296,14 @@ bool cmCPackWIXGenerator::PackageFilesImpl() usedBaseNames.insert(uniqueBaseName); std::string objectFilename = - cmStrCat(this->CPackTopLevel, "/", uniqueBaseName, ".wixobj"); + cmStrCat(this->CPackTopLevel, '/', uniqueBaseName, ".wixobj"); if (!RunCandleCommand(CMakeToWixPath(sourceFilename), CMakeToWixPath(objectFilename))) { return false; } - objectFiles << " " << QuotePath(CMakeToWixPath(objectFilename)); + objectFiles << ' ' << QuotePath(CMakeToWixPath(objectFilename)); } AppendUserSuppliedExtraObjects(objectFiles); @@ -795,13 +795,13 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType( std::string idSuffix; if (!cpackComponentName.empty()) { - idSuffix += "_"; + idSuffix += '_'; idSuffix += cpackComponentName; } std::string componentId = "CM_SHORTCUT"; if (idPrefix.size()) { - componentId += cmStrCat("_", idPrefix); + componentId += cmStrCat('_', idPrefix); } componentId += idSuffix; @@ -817,7 +817,7 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType( this->Patch->ApplyFragment(componentId, fileDefinitions); std::string registryKey = - cmStrCat("Software\\", cpackVendor, "\\", cpackPackageName); + cmStrCat("Software\\", cpackVendor, '\\', cpackPackageName); shortcuts.EmitShortcuts(type, registryKey, cpackComponentName, fileDefinitions); @@ -934,7 +934,7 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitions( continue; } - std::string fullPath = cmStrCat(topdir, "/", fileName); + std::string fullPath = cmStrCat(topdir, '/', fileName); std::string relativePath = cmSystemTools::RelativePath(toplevel.c_str(), fullPath.c_str()); @@ -1041,7 +1041,7 @@ std::string cmCPackWIXGenerator::GenerateGUID() std::string cmCPackWIXGenerator::QuotePath(std::string const& path) { - return cmStrCat("\"", path, '"'); + return cmStrCat('"', path, '"'); } std::string cmCPackWIXGenerator::GetRightmostExtension( @@ -1095,18 +1095,18 @@ std::string cmCPackWIXGenerator::CreateNewIdForPath(std::string const& path) } std::ostringstream result; - result << idPrefix << "_" << identifier; + result << idPrefix << '_' << identifier; size_t ambiguityCount = ++IdAmbiguityCounter[identifier]; if (ambiguityCount > 999) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while trying to generate a unique Id for '" - << path << "'" << std::endl); + << path << '\'' << std::endl); return std::string(); } else if (ambiguityCount > 1) { - result << "_" << ambiguityCount; + result << '_' << ambiguityCount; } std::string resultString = result.str(); @@ -1190,7 +1190,7 @@ void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName, cmCPackLogger(cmCPackLog::LOG_ERROR, "Invalid element in CPACK_WIX_CUSTOM_XMLNS ignored: " "\"" - << str << "\"" << std::endl); + << str << '"' << std::endl); } } std::ostringstream oss; @@ -1211,7 +1211,7 @@ void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName, cmList list{ variableContent }; for (std::string const& i : list) { - stream << " " << QuotePath(i); + stream << ' ' << QuotePath(i); } } diff --git a/Source/CPack/WiX/cmWIXAccessControlList.cxx b/Source/CPack/WiX/cmWIXAccessControlList.cxx index 5dcd086..6aba228 100644 --- a/Source/CPack/WiX/cmWIXAccessControlList.cxx +++ b/Source/CPack/WiX/cmWIXAccessControlList.cxx @@ -119,7 +119,7 @@ void cmWIXAccessControlList::EmitBooleanAttribute(std::string const& entry, { if (!this->IsBooleanAttribute(name)) { this->ReportError(entry, - cmStrCat("Unknown boolean attribute '", name, "'")); + cmStrCat("Unknown boolean attribute '", name, '\'')); } this->SourceWriter.AddAttribute(name, "yes"); diff --git a/Source/CPack/WiX/cmWIXPatch.cxx b/Source/CPack/WiX/cmWIXPatch.cxx index 122ffaf..c3ada17 100644 --- a/Source/CPack/WiX/cmWIXPatch.cxx +++ b/Source/CPack/WiX/cmWIXPatch.cxx @@ -14,7 +14,7 @@ bool cmWIXPatch::LoadFragments(std::string const& patchFilePath) cmWIXPatchParser parser(Fragments, Logger); if (!parser.ParseFile(patchFilePath.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Failed parsing XML patch file: '" << patchFilePath << "'" + "Failed parsing XML patch file: '" << patchFilePath << '\'' << std::endl); return false; } @@ -75,9 +75,9 @@ bool cmWIXPatch::CheckForUnappliedFragments() fragmentList += ", "; } - fragmentList += "'"; + fragmentList += '\''; fragmentList += fragment.first; - fragmentList += "'"; + fragmentList += '\''; } if (!fragmentList.empty()) { diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx index 57539d3..6a44d63 100644 --- a/Source/CPack/WiX/cmWIXPatchParser.cxx +++ b/Source/CPack/WiX/cmWIXPatchParser.cxx @@ -143,7 +143,7 @@ void cmWIXPatchParser::ReportError(int line, int column, const char* msg) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while processing XML patch file at " - << line << ":" << column << ": " << msg << std::endl); + << line << ':' << column << ": " << msg << std::endl); Valid = false; } diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx index d7e534a..f3fe3de 100644 --- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx +++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx @@ -135,7 +135,7 @@ void cmWIXRichTextFormatWriter::WriteDocumentPrefix() void cmWIXRichTextFormatWriter::ControlWord(std::string const& keyword) { - File << "\\" << keyword; + File << '\\' << keyword; } void cmWIXRichTextFormatWriter::NewControlWord(std::string const& keyword) @@ -175,12 +175,12 @@ void cmWIXRichTextFormatWriter::EmitUnicodeSurrogate(int c) } else { File << (c - 65536); } - File << "?"; + File << '?'; } void cmWIXRichTextFormatWriter::EmitInvalidCodepoint(int c) { ControlWord("cf1 "); - File << "[INVALID-BYTE-" << int(c) << "]"; + File << "[INVALID-BYTE-" << int(c) << ']'; ControlWord("cf0 "); } diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index 8e9bfdf..e13a3e0 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -34,7 +34,7 @@ cmWIXSourceWriter::~cmWIXSourceWriter() cmCPackLogger(cmCPackLog::LOG_ERROR, Elements.size() - 1 << " WiX elements were still open when closing '" - << SourceFilename << "'" << std::endl); + << SourceFilename << '\'' << std::endl); return; } @@ -44,12 +44,12 @@ cmWIXSourceWriter::~cmWIXSourceWriter() void cmWIXSourceWriter::BeginElement(std::string const& name) { if (State == BEGIN) { - File << ">"; + File << '>'; } - File << "\n"; + File << '\n'; Indent(Elements.size()); - File << "<" << name; + File << '<' << name; Elements.push_back(name); State = BEGIN; @@ -60,7 +60,7 @@ void cmWIXSourceWriter::EndElement(std::string const& name) if (Elements.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "can not end WiX element with no open elements in '" - << SourceFilename << "'" << std::endl); + << SourceFilename << '\'' << std::endl); return; } @@ -68,14 +68,14 @@ void cmWIXSourceWriter::EndElement(std::string const& name) cmCPackLogger(cmCPackLog::LOG_ERROR, "WiX element <" << Elements.back() << "> can not be closed by </" << name - << "> in '" << SourceFilename << "'" << std::endl); + << "> in '" << SourceFilename << '\'' << std::endl); return; } if (State == DEFAULT) { - File << "\n"; + File << '\n'; Indent(Elements.size() - 1); - File << "</" << Elements.back() << ">"; + File << "</" << Elements.back() << '>'; } else { File << "/>"; } @@ -87,13 +87,13 @@ void cmWIXSourceWriter::EndElement(std::string const& name) void cmWIXSourceWriter::AddTextNode(std::string const& text) { if (State == BEGIN) { - File << ">"; + File << '>'; } if (Elements.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "can not add text without open WiX element in '" - << SourceFilename << "'" << std::endl); + << SourceFilename << '\'' << std::endl); return; } @@ -105,12 +105,12 @@ void cmWIXSourceWriter::AddProcessingInstruction(std::string const& target, std::string const& content) { if (State == BEGIN) { - File << ">"; + File << '>'; } - File << "\n"; + File << '\n'; Indent(Elements.size()); - File << "<?" << target << " " << content << "?>"; + File << "<?" << target << ' ' << content << "?>"; State = DEFAULT; } @@ -118,7 +118,7 @@ void cmWIXSourceWriter::AddProcessingInstruction(std::string const& target, void cmWIXSourceWriter::AddAttribute(std::string const& key, std::string const& value) { - File << " " << key << "=\"" << EscapeAttributeValue(value) << '"'; + File << ' ' << key << "=\"" << EscapeAttributeValue(value) << '"'; } void cmWIXSourceWriter::AddAttributeUnlessEmpty(std::string const& key, |