summaryrefslogtreecommitdiff
path: root/slicer/xml/serializer.h
diff options
context:
space:
mode:
Diffstat (limited to 'slicer/xml/serializer.h')
-rw-r--r--slicer/xml/serializer.h48
1 files changed, 10 insertions, 38 deletions
diff --git a/slicer/xml/serializer.h b/slicer/xml/serializer.h
index d07a77e..9c6e1ae 100644
--- a/slicer/xml/serializer.h
+++ b/slicer/xml/serializer.h
@@ -1,7 +1,6 @@
#ifndef SLICER_XML_H
#define SLICER_XML_H
-#include <lazyPointer.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wsign-conversion"
@@ -9,39 +8,22 @@
# pragma GCC diagnostic ignored "-Wuseless-cast"
#endif
#include <libxml++/document.h>
-#include <libxml++/nodes/element.h>
#pragma GCC diagnostic pop
#include <filesystem>
#include <fstream>
-#include <functional>
-#include <iosfwd>
#include <slicer/modelParts.h>
#include <slicer/serializer.h>
#include <string>
#include <visibility.h>
+
namespace Glib {
class ustring;
}
namespace Slicer {
- using CurrentElementCreator = ::AdHoc::LazyPointer<xmlpp::Element, xmlpp::Element *>;
-
- class DLL_PUBLIC XmlSerializer : public Serializer {
- protected:
- using ElementCreator = std::function<xmlpp::Element *(xmlpp::Element *, const Glib::ustring &)>;
- static void ModelTreeIterate(xmlpp::Element *, const std::string &, const ModelPartPtr & mp,
- const HookCommon * hp, const ElementCreator &);
- static void ModelTreeIterateRoot(xmlpp::Document *, const std::string &, const ModelPartPtr & mp);
-
- protected:
- static void ModelTreeProcessElement(const CurrentElementCreator &, ModelPartPtr mp, const ElementCreator &);
- static void ModelTreeIterateDictAttrs(xmlpp::Element * element, const ModelPartPtr & dict);
- static void ModelTreeIterateDictElements(xmlpp::Element * element, const ModelPartPtr & dict);
- };
-
- class DLL_PUBLIC XmlDocumentSerializer : public XmlSerializer {
+ class DLL_PUBLIC XmlDocumentSerializer : public Serializer {
public:
- void Serialize(ModelPartForRootPtr) override;
+ void Serialize(ModelPartForRootParam) override;
protected:
xmlpp::Document doc;
@@ -51,7 +33,7 @@ namespace Slicer {
public:
explicit XmlStreamSerializer(std::ostream &);
- void Serialize(ModelPartForRootPtr) override;
+ void Serialize(ModelPartForRootParam) override;
protected:
std::ostream & strm;
@@ -65,41 +47,31 @@ namespace Slicer {
std::ofstream strm;
};
- class DLL_PUBLIC XmlDeserializer : public Deserializer {
- protected:
- static void DocumentTreeIterate(const xmlpp::Node * node, const ModelPartPtr & mp);
- static void DocumentTreeIterateElement(const xmlpp::Element * element, ModelPartPtr mp, const ChildRef & c);
- static void DocumentTreeIterate(const xmlpp::Document * doc, const ModelPartPtr & mp);
- static void DocumentTreeIterateDictAttrs(
- const xmlpp::Element::const_AttributeList & attrs, const ModelPartPtr & dict);
- static void DocumentTreeIterateDictElements(const xmlpp::Element * parent, const ModelPartPtr & dict);
- };
-
- class DLL_PUBLIC XmlStreamDeserializer : public XmlDeserializer {
+ class DLL_PUBLIC XmlStreamDeserializer : public Deserializer {
public:
explicit XmlStreamDeserializer(std::istream &);
- void Deserialize(ModelPartForRootPtr) override;
+ void Deserialize(ModelPartForRootParam) override;
protected:
std::istream & strm;
};
- class DLL_PUBLIC XmlFileDeserializer : public XmlDeserializer {
+ class DLL_PUBLIC XmlFileDeserializer : public Deserializer {
public:
explicit XmlFileDeserializer(std::filesystem::path);
- void Deserialize(ModelPartForRootPtr) override;
+ void Deserialize(ModelPartForRootParam) override;
protected:
const std::filesystem::path path;
};
- class DLL_PUBLIC XmlDocumentDeserializer : public XmlDeserializer {
+ class DLL_PUBLIC XmlDocumentDeserializer : public Deserializer {
public:
explicit XmlDocumentDeserializer(const xmlpp::Document *);
- void Deserialize(ModelPartForRootPtr) override;
+ void Deserialize(ModelPartForRootParam) override;
protected:
const xmlpp::Document * doc;