summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-08-11 20:31:45 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-08-11 20:31:45 +0100
commitcd0c07dc0c3300e51d0fac5d99f70783bb2d5ffb (patch)
treefc109bb44f42ae71609d06341f0707a62a6a359f
parentSet the perf data in the message, not the name :\ (diff)
downloadgentoobrowse-api-cd0c07dc0c3300e51d0fac5d99f70783bb2d5ffb.tar.bz2
gentoobrowse-api-cd0c07dc0c3300e51d0fac5d99f70783bb2d5ffb.tar.xz
gentoobrowse-api-cd0c07dc0c3300e51d0fac5d99f70783bb2d5ffb.zip
Use simplified XmlDocumentSerializer interface
-rw-r--r--gentoobrowse-api/service/xsltStreamSerializer.cpp10
-rw-r--r--gentoobrowse-api/service/xsltStreamSerializer.h3
2 files changed, 3 insertions, 10 deletions
diff --git a/gentoobrowse-api/service/xsltStreamSerializer.cpp b/gentoobrowse-api/service/xsltStreamSerializer.cpp
index cebae7b..acb5750 100644
--- a/gentoobrowse-api/service/xsltStreamSerializer.cpp
+++ b/gentoobrowse-api/service/xsltStreamSerializer.cpp
@@ -36,20 +36,16 @@ namespace Gentoo {
}
XsltStreamSerializer::XsltStreamSerializer(IceTray::Mail::EmailPtr e, xsltStylesheet * ss) :
- Slicer::XmlDocumentSerializer(doc), mail(std::move(e)), doc(nullptr), stylesheet(ss)
+ mail(std::move(e)), stylesheet(ss)
{
}
- XsltStreamSerializer::~XsltStreamSerializer()
- {
- delete doc;
- }
-
void
XsltStreamSerializer::Serialize(Slicer::ModelPartForRootPtr mp)
{
Slicer::XmlDocumentSerializer::Serialize(mp);
- auto result = std::shared_ptr<xmlDoc>(xsltApplyStylesheet(stylesheet, doc->cobj(), nullptr), xmlFreeDoc);
+ auto result = std::unique_ptr<xmlDoc, decltype(&xmlFreeDoc)>(
+ xsltApplyStylesheet(stylesheet, doc.cobj(), nullptr), xmlFreeDoc);
if (!result) {
throw xmlpp::exception("Failed to apply XSL transform");
}
diff --git a/gentoobrowse-api/service/xsltStreamSerializer.h b/gentoobrowse-api/service/xsltStreamSerializer.h
index f13f774..71f5e3f 100644
--- a/gentoobrowse-api/service/xsltStreamSerializer.h
+++ b/gentoobrowse-api/service/xsltStreamSerializer.h
@@ -14,8 +14,6 @@ namespace Gentoo {
class DLL_PUBLIC XsltStreamSerializer : public Slicer::XmlDocumentSerializer {
public:
XsltStreamSerializer(IceTray::Mail::EmailPtr, xsltStylesheet *);
- ~XsltStreamSerializer() override;
- SPECIAL_MEMBERS_DELETE(XsltStreamSerializer);
void Serialize(Slicer::ModelPartForRootPtr mp) override;
@@ -24,7 +22,6 @@ namespace Gentoo {
static IceTray::Mime::BasicPartPtr getText(xmlDoc *);
IceTray::Mail::EmailPtr mail;
- xmlpp::Document * doc;
xsltStylesheet * stylesheet;
};
}