DamarisVar::returnXMLForVariable: simplify using fmt

This commit is contained in:
Arne Morten Kvarving
2024-01-30 09:36:31 +01:00
parent 033943e42e
commit bdc0790eb8

View File

@@ -26,7 +26,6 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <sstream>
#include <string_view> #include <string_view>
#include <typeinfo> #include <typeinfo>
@@ -139,14 +138,8 @@ void DamarisVar<T>::printError() const
template<class T> template<class T>
std::string DamarisVar<T>::returnXMLForVariable() std::string DamarisVar<T>::returnXMLForVariable()
{ {
std::ostringstream var_sstr; return fmt::format("<variable name=\"{}\" {} />", variable_name_,
xml_attributes_.ReturnXMLForVariable());
var_sstr << "<variable "
<< " name=\"" << variable_name_ << "\"";
var_sstr << xml_attributes_.ReturnXMLForVariable();
var_sstr << " /> ";
return var_sstr.str();
} }
template<class T> template<class T>