Mercurial > hg > orthanc
diff Core/Toolbox.cpp @ 3203:810772486249
URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 06 Feb 2019 15:45:16 +0100 |
parents | 4e43e67f8ecf |
children | cf8cbeb35f33 |
line wrap: on
line diff
--- a/Core/Toolbox.cpp Wed Feb 06 15:21:32 2019 +0100 +++ b/Core/Toolbox.cpp Wed Feb 06 15:45:16 2019 +0100 @@ -99,7 +99,6 @@ #if ORTHANC_ENABLE_PUGIXML == 1 # include "ChunkedBuffer.h" -# include <pugixml.hpp> #endif @@ -1023,11 +1022,16 @@ decl.append_attribute("version").set_value("1.0"); decl.append_attribute("encoding").set_value("utf-8"); + XmlToString(target, doc); + } + + void Toolbox::XmlToString(std::string& target, + const pugi::xml_document& source) + { ChunkedBufferWriter writer; - doc.save(writer, " ", pugi::format_default, pugi::encoding_utf8); + source.save(writer, " ", pugi::format_default, pugi::encoding_utf8); writer.Flatten(target); } - #endif