From e4fa505e2ce41b753c132c00f8c79290ee8f5936 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 9 May 2024 12:00:47 +0200 Subject: Added missing xml.h --- xml.cpp | 9 +++++++++ xml.h | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 xml.cpp create mode 100644 xml.h diff --git a/xml.cpp b/xml.cpp new file mode 100644 index 0000000..d4e7162 --- /dev/null +++ b/xml.cpp @@ -0,0 +1,9 @@ +#include "xml.h" + +#include + +std::string Reichwein::XML::plain_xml(const boost::property_tree::ptree& ptree) { + std::ostringstream oss; + boost::property_tree::xml_parser::write_xml_element(oss, {}, ptree, -1, boost::property_tree::xml_writer_settings{}); + return oss.str(); +} diff --git a/xml.h b/xml.h new file mode 100644 index 0000000..44471dd --- /dev/null +++ b/xml.h @@ -0,0 +1,10 @@ +#pragma once + +#include +#include + +#define EXPORT __attribute__((visibility("default"))) + +namespace Reichwein::XML { + EXPORT std::string plain_xml(const boost::property_tree::ptree& ptree); +} -- cgit v1.2.3