aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/xml-writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/xml-writer.cc')
-rw-r--r--src/libutil/xml-writer.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libutil/xml-writer.cc b/src/libutil/xml-writer.cc
index 68857e34d..7993bee9a 100644
--- a/src/libutil/xml-writer.cc
+++ b/src/libutil/xml-writer.cc
@@ -31,11 +31,12 @@ void XMLWriter::close()
void XMLWriter::indent_(size_t depth)
{
if (!indent) return;
- output << string(depth * 2, ' ');
+ output << std::string(depth * 2, ' ');
}
-void XMLWriter::openElement(const string & name,
+void XMLWriter::openElement(
+ std::string_view name,
const XMLAttrs & attrs)
{
assert(!closed);
@@ -44,7 +45,7 @@ void XMLWriter::openElement(const string & name,
writeAttrs(attrs);
output << ">";
if (indent) output << std::endl;
- pendingElems.push_back(name);
+ pendingElems.push_back(std::string(name));
}
@@ -59,7 +60,8 @@ void XMLWriter::closeElement()
}
-void XMLWriter::writeEmptyElement(const string & name,
+void XMLWriter::writeEmptyElement(
+ std::string_view name,
const XMLAttrs & attrs)
{
assert(!closed);