summaryrefslogtreecommitdiffstats
path: root/Source/CPack/WiX/cmWIXPatchParser.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack/WiX/cmWIXPatchParser.cxx')
-rw-r--r--Source/CPack/WiX/cmWIXPatchParser.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx
index 8b26c4e..57539d3 100644
--- a/Source/CPack/WiX/cmWIXPatchParser.cxx
+++ b/Source/CPack/WiX/cmWIXPatchParser.cxx
@@ -5,6 +5,7 @@
#include <utility>
#include <cm/memory>
+#include <cmext/string_view>
#include <cm3p/expat.h>
@@ -39,13 +40,13 @@ cmWIXPatchParser::cmWIXPatchParser(fragment_map_t& fragments,
void cmWIXPatchParser::StartElement(const std::string& name, const char** atts)
{
if (State == BEGIN_DOCUMENT) {
- if (name == "CPackWiXPatch") {
+ if (name == "CPackWiXPatch"_s) {
State = BEGIN_FRAGMENTS;
} else {
ReportValidationError("Expected root element 'CPackWiXPatch'");
}
} else if (State == BEGIN_FRAGMENTS) {
- if (name == "CPackWiXFragment") {
+ if (name == "CPackWiXFragment"_s) {
State = INSIDE_FRAGMENT;
StartFragment(atts);
} else {
@@ -78,7 +79,7 @@ void cmWIXPatchParser::StartFragment(const char** attributes)
const std::string key = attributes[i];
const std::string value = attributes[i + 1];
- if (key == "Id") {
+ if (key == "Id"_s) {
if (Fragments.find(value) != Fragments.end()) {
std::ostringstream tmp;
tmp << "Invalid reuse of 'CPackWixFragment' 'Id': " << value;
@@ -98,7 +99,7 @@ void cmWIXPatchParser::StartFragment(const char** attributes)
const std::string key = attributes[i];
const std::string value = attributes[i + 1];
- if (key != "Id") {
+ if (key != "Id"_s) {
new_element->attributes[key] = value;
}
}
@@ -108,7 +109,7 @@ void cmWIXPatchParser::StartFragment(const char** attributes)
void cmWIXPatchParser::EndElement(const std::string& name)
{
if (State == INSIDE_FRAGMENT) {
- if (name == "CPackWiXFragment") {
+ if (name == "CPackWiXFragment"_s) {
State = BEGIN_FRAGMENTS;
ElementStack.clear();
} else {