From 025468f858ab05b15e4b02bf7b59297f90b036e7 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 28 Apr 2017 19:18:10 +0100 Subject: Upgrade to libxml++3 --- Jamroot.jam | 8 ++++---- slicer/xml/serializer.cpp | 14 +++++++------- slicer/xml/serializer.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Jamroot.jam b/Jamroot.jam index fc23554..3e015d5 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -38,7 +38,7 @@ build-project slicer ; # Some useful aliases -lib xml++-2.6 ; +lib xml++-3.0 ; lib xml2 ; lib glibmm-2.4 ; lib gobject-2.0 ; @@ -46,8 +46,8 @@ lib glib-2.0 ; lib sigc-2.0 ; alias libxmlpp : : : : - /usr/include/libxml++-2.6 - /usr/lib/libxml++-2.6/include + /usr/include/libxml++-3.0 + /usr/lib/libxml++-3.0/include /usr/include/libxml2 /usr/include/glibmm-2.4 /usr/lib/glibmm-2.4/include @@ -55,7 +55,7 @@ alias libxmlpp : : : : /usr/lib/glib-2.0/include /usr/include/sigc++-2.0 /usr/lib/sigc++-2.0/include - xml++-2.6 + xml++-3.0 xml2 glibmm-2.4 gobject-2.0 diff --git a/slicer/xml/serializer.cpp b/slicer/xml/serializer.cpp index 08101ba..4c0c7c2 100644 --- a/slicer/xml/serializer.cpp +++ b/slicer/xml/serializer.cpp @@ -23,7 +23,7 @@ namespace Slicer { const std::string md_elements = "xml:elements"; const std::string keyName = "key"; const std::string valueName = "value"; - const auto defaultElementCreator = boost::bind(&xmlpp::Element::add_child, _1, _2, Glib::ustring()); + const auto defaultElementCreator = boost::bind(&xmlpp::Element::add_child_element, _1, _2, Glib::ustring()); static const Glib::ustring TrueText("true"); static const Glib::ustring FalseText("false"); @@ -169,13 +169,13 @@ namespace Slicer { class XmlContentValueTarget : public XmlValueTarget { public: XmlContentValueTarget(xmlpp::Element * p) : - XmlValueTarget(boost::bind(&xmlpp::Element::set_child_text, p, _1)) + XmlValueTarget(boost::bind(&xmlpp::Element::set_first_child_text, p, _1)) { } }; void - XmlDeserializer::DocumentTreeIterateDictAttrs(const xmlpp::Element::AttributeList & attrs, ModelPartPtr dict) + XmlDeserializer::DocumentTreeIterateDictAttrs(const xmlpp::Element::const_AttributeList & attrs, ModelPartPtr dict) { for (const auto & attr : attrs) { auto emp = dict->GetAnonChild(); @@ -304,14 +304,14 @@ namespace Slicer { mp->GetValue(new XmlContentValueTarget(n)); } else if (hp && metaDataFlagSet(hp->GetMetadata(), md_attributes)) { - ModelTreeIterateDictAttrs(n->add_child(name), mp); + ModelTreeIterateDictAttrs(n->add_child_element(name), mp); } else if (hp && metaDataFlagSet(hp->GetMetadata(), md_elements)) { - ModelTreeIterateDictElements(n->add_child(name), mp); + ModelTreeIterateDictElements(n->add_child_element(name), mp); } else { if (hp && metaDataFlagSet(hp->GetMetadata(), md_bare)) { - ModelTreeProcessElement(n, mp, boost::bind(&xmlpp::Element::add_child, _1, name, Glib::ustring())); + ModelTreeProcessElement(n, mp, boost::bind(&xmlpp::Element::add_child_element, _1, name, Glib::ustring())); } else { ModelTreeProcessElement(ec(n, name), mp, defaultElementCreator); @@ -334,7 +334,7 @@ namespace Slicer { { dict->OnEachChild([element](const auto &, const auto & mp, const auto &) { mp->GetChild(keyName)->GetValue(new XmlValueTarget([&mp,element](const auto & name) { - ModelTreeProcessElement(element->add_child(name), mp->GetChild(valueName), defaultElementCreator); + ModelTreeProcessElement(element->add_child_element(name), mp->GetChild(valueName), defaultElementCreator); })); }); } diff --git a/slicer/xml/serializer.h b/slicer/xml/serializer.h index 5b56ad1..5521dc4 100644 --- a/slicer/xml/serializer.h +++ b/slicer/xml/serializer.h @@ -54,7 +54,7 @@ namespace Slicer { static void DocumentTreeIterate(const xmlpp::Node * node, ModelPartPtr mp); static void DocumentTreeIterateElement(const xmlpp::Element * element, ModelPartPtr mp, ChildRefPtr c); static void DocumentTreeIterate(const xmlpp::Document * doc, ModelPartPtr mp); - static void DocumentTreeIterateDictAttrs(const xmlpp::Element::AttributeList & attrs, ModelPartPtr dict); + static void DocumentTreeIterateDictAttrs(const xmlpp::Element::const_AttributeList & attrs, ModelPartPtr dict); static void DocumentTreeIterateDictElements(const xmlpp::Element * parent, ModelPartPtr dict); }; -- cgit v1.2.3