diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-04-28 19:18:10 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-04-28 19:18:10 +0100 |
commit | 0e12e1b18ae93362c8933714ee86003766abae11 (patch) | |
tree | 565af0a0778513901ac380ab922dc996af1a3149 | |
parent | Set cxxflags specifically, not cflags (diff) | |
download | project2-0e12e1b18ae93362c8933714ee86003766abae11.tar.bz2 project2-0e12e1b18ae93362c8933714ee86003766abae11.tar.xz project2-0e12e1b18ae93362c8933714ee86003766abae11.zip |
Upgrade to libxml++3project2-1.2.8
-rw-r--r-- | Jamroot.jam | 8 | ||||
-rw-r--r-- | project2/xml/Jamfile.jam | 7 | ||||
-rw-r--r-- | project2/xml/mutators/copy.cpp | 2 | ||||
-rw-r--r-- | project2/xml/mutators/copyToAttr.cpp | 4 | ||||
-rw-r--r-- | project2/xml/mutators/create.cpp | 5 | ||||
-rw-r--r-- | project2/xml/mutators/delete.cpp | 4 | ||||
-rw-r--r-- | project2/xml/rawView.cpp | 4 | ||||
-rw-r--r-- | project2/xml/sessionXml.cpp | 6 | ||||
-rw-r--r-- | project2/xml/xmlPresenter.cpp | 4 | ||||
-rw-r--r-- | project2/xml/xmlRawRows.cpp | 2 | ||||
-rw-r--r-- | project2/xml/xmlScriptParser.cpp | 6 |
11 files changed, 25 insertions, 27 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 : : : : - <include>/usr/include/libxml++-2.6 - <include>/usr/lib/libxml++-2.6/include + <include>/usr/include/libxml++-3.0 + <include>/usr/lib/libxml++-3.0/include <include>/usr/include/libxml2 <include>/usr/include/glibmm-2.4 <include>/usr/lib/glibmm-2.4/include @@ -55,7 +55,7 @@ alias libxmlpp : : : : <include>/usr/lib/glib-2.0/include <include>/usr/include/sigc++-2.0 <include>/usr/lib/sigc++-2.0/include - <library>xml++-2.6 + <library>xml++-3.0 <library>xml2 <library>glibmm-2.4 <library>gobject-2.0 diff --git a/project2/xml/Jamfile.jam b/project2/xml/Jamfile.jam index d52bec8..e9bffca 100644 --- a/project2/xml/Jamfile.jam +++ b/project2/xml/Jamfile.jam @@ -1,6 +1,3 @@ -alias libxmlpp : : : : - <cflags>"`pkg-config --cflags libxml++-2.6`" - <linkflags>"`pkg-config --libs libxml++-2.6`" ; alias libxslt : : : : <cflags>"`pkg-config --cflags libexslt`" <linkflags>"`pkg-config --libs libexslt`" ; @@ -10,7 +7,7 @@ lib Ice ; lib IceUtil ; cpp-pch pch : pch.hpp : - <library>libxmlpp + <library>../..//libxmlpp <library>../common//p2common ; lib p2xml : @@ -18,7 +15,7 @@ lib p2xml : [ glob-tree *.cpp : unittests ] : <include>. - <library>libxmlpp + <library>../..//libxmlpp <library>../common//p2common <library>../url//p2url <library>..//adhocutil diff --git a/project2/xml/mutators/copy.cpp b/project2/xml/mutators/copy.cpp index c94d76d..a40eaf6 100644 --- a/project2/xml/mutators/copy.cpp +++ b/project2/xml/mutators/copy.cpp @@ -17,7 +17,7 @@ class Copy : public XmlDocMutator { for (xmlpp::Node * t : e->find(to(NULL))) { t->import_node(e); if (delAfter(NULL)) { - e->get_parent()->remove_child(e); + e->get_parent()->remove_node(e); } } } diff --git a/project2/xml/mutators/copyToAttr.cpp b/project2/xml/mutators/copyToAttr.cpp index 6311f1a..a82920b 100644 --- a/project2/xml/mutators/copyToAttr.cpp +++ b/project2/xml/mutators/copyToAttr.cpp @@ -17,9 +17,9 @@ class CopyToAttr : public XmlDocMutator { if (xmlpp::Element * ee = dynamic_cast<xmlpp::Element *>(e)) { for (xmlpp::Node * t : e->find(to(NULL))) { if (xmlpp::Element * te = dynamic_cast<xmlpp::Element *>(t)) { - te->set_attribute(e->get_name(), ee->get_child_text()->get_content()); + te->set_attribute(e->get_name(), ee->get_first_child_text()->get_content()); if (delAfter(NULL)) { - e->get_parent()->remove_child(e); + e->get_parent()->remove_node(e); } } } diff --git a/project2/xml/mutators/create.cpp b/project2/xml/mutators/create.cpp index 645914f..6bb7940 100644 --- a/project2/xml/mutators/create.cpp +++ b/project2/xml/mutators/create.cpp @@ -12,8 +12,9 @@ class Create : public XmlDocMutator { } void mutateElement(xmlpp::Element * root) const { - for (xmlpp::Node * e : root->find(xpath(NULL))) { - e->add_child(name(NULL)); + for (xmlpp::Node * n : root->find(xpath(NULL))) { + if (auto e = dynamic_cast<xmlpp::Element *>(n)) + e->add_child_element(name(NULL)); } } Variable xpath; diff --git a/project2/xml/mutators/delete.cpp b/project2/xml/mutators/delete.cpp index f1c3f61..d14b0ee 100644 --- a/project2/xml/mutators/delete.cpp +++ b/project2/xml/mutators/delete.cpp @@ -11,8 +11,8 @@ class Delete : public XmlDocMutator { } void mutateElement(xmlpp::Element * root) const { - for (xmlpp::Node * e : root->find(xpath(NULL))) { - e->get_parent()->remove_child(e); + for (xmlpp::Node * n : root->find(xpath(NULL))) { + n->get_parent()->remove_node(n); } } Variable xpath; diff --git a/project2/xml/rawView.cpp b/project2/xml/rawView.cpp index e5f7c50..1b0a9f6 100644 --- a/project2/xml/rawView.cpp +++ b/project2/xml/rawView.cpp @@ -35,14 +35,14 @@ class RawViewBase : public View { p->setNamespace(n->get_namespace_prefix(), n->get_namespace_uri()); } p->pushSub(n->get_name(), n->get_namespace_prefix()); - xmlpp::Element::AttributeList al = n->get_attributes(); + auto al = n->get_attributes(); for (const xmlpp::Attribute * a : al) { if (!a->get_namespace_uri().empty()) { p->setNamespace(a->get_namespace_prefix(), a->get_namespace_uri()); } p->addAttribute(a->get_name(), a->get_namespace_prefix(), a->get_value()); } - const xmlpp::Node::NodeList ch = n->get_children(); + auto ch = n->get_children(); for (const xmlpp::Node * c : ch) { if (const xmlpp::Element * e = dynamic_cast<const xmlpp::Element *>(c)) { copyNode(p, e); diff --git a/project2/xml/sessionXml.cpp b/project2/xml/sessionXml.cpp index 403e91a..756f676 100644 --- a/project2/xml/sessionXml.cpp +++ b/project2/xml/sessionXml.cpp @@ -52,7 +52,7 @@ static void appendToXmlNode(xmlpp::Element * sess, const Glib::ustring & name, const VariableType & value) { - xmlpp::Element * v = sess->add_child(name); + xmlpp::Element * v = sess->add_child_element(name); v->add_child_text(value); } @@ -83,8 +83,8 @@ SessionContainerXml::getSession(const boost::uuids::uuid & sid) const SessionPtr s = new Session(sid); for (const xmlpp::Node * n : sess->get_children()) { if (const xmlpp::Element * e = dynamic_cast<const xmlpp::Element *>(n)) { - if (e->get_child_text()) { - s->SetValue(e->get_name(), e->get_child_text()->get_content()); + if (e->get_first_child_text()) { + s->SetValue(e->get_name(), e->get_first_child_text()->get_content()); } else { s->SetValue(e->get_name(), Null()); diff --git a/project2/xml/xmlPresenter.cpp b/project2/xml/xmlPresenter.cpp index 59543e0..f6ada8c 100644 --- a/project2/xml/xmlPresenter.cpp +++ b/project2/xml/xmlPresenter.cpp @@ -127,7 +127,7 @@ XmlPresenter::setNamespace(const Glib::ustring & prefix, const Glib::ustring & n void XmlPresenter::pushSub(const Glib::ustring & name, const Glib::ustring & ns) const { - nodeStack.push_back(nodeStack.back()->add_child(name, ns)); + nodeStack.push_back(nodeStack.back()->add_child_element(name, ns)); } void @@ -234,7 +234,7 @@ void XmlPresenter::addNewArray(const Glib::ustring & name, bool objects) const { if (!objects) { - nodeStack.push_back(nodeStack.back()->add_child(name)); + nodeStack.push_back(nodeStack.back()->add_child_element(name)); } } diff --git a/project2/xml/xmlRawRows.cpp b/project2/xml/xmlRawRows.cpp index 6c3dd3a..cbc3b77 100644 --- a/project2/xml/xmlRawRows.cpp +++ b/project2/xml/xmlRawRows.cpp @@ -70,7 +70,7 @@ void XmlRawRowsBase::execute(const xmlpp::Document * doc, const RowProcessorCall unsigned int col = 0; for (const xmlpp::Node * in : rs.e->get_children()) { if (const xmlpp::Element * ie = dynamic_cast<const xmlpp::Element *>(in)) { - const xmlpp::TextNode * t = ie->get_child_text(); + const xmlpp::TextNode * t = ie->get_first_child_text(); if (t) { rs.fields[col] = VariableType::make(t->get_content(), VariableType::getTypeFromName(ie->get_attribute_value("type", Scripts::scriptNamespacePrefix))); diff --git a/project2/xml/xmlScriptParser.cpp b/project2/xml/xmlScriptParser.cpp index 33b464e..bb4bcb6 100644 --- a/project2/xml/xmlScriptParser.cpp +++ b/project2/xml/xmlScriptParser.cpp @@ -149,7 +149,7 @@ XmlScriptNode::children() const ScriptNodePtr XmlScriptNode::child(const Glib::ustring & n, bool required) const { - const xmlpp::Element::NodeList cs = element->get_children(n); + auto cs = element->get_children(n); if (cs.size() == 1) { if (const xmlpp::Element * c = dynamic_cast<const xmlpp::Element *>(cs.front())) { return new XmlScriptNode(c, script); @@ -183,7 +183,7 @@ XmlScriptNode::variable(const Glib::ustring & n) const if (const xmlpp::Attribute * a = element->get_attribute(n)) { return new VariableLiteral(a->get_value()); } - const xmlpp::Element::NodeList cs = element->get_children(n); + auto cs = element->get_children(n); if (cs.size() == 1) { if (const xmlpp::Element * c = dynamic_cast<const xmlpp::Element *>(cs.front())) { if (const xmlpp::Attribute * source = c->get_attribute("source")) { @@ -218,7 +218,7 @@ XmlScriptNode::applyValue(const Glib::ustring & n, VariableType & val, ExecConte val = a->get_value(); return true; } - const xmlpp::Element::NodeList cs = element->get_children(n); + auto cs = element->get_children(n); if (cs.size() == 1) { if (const xmlpp::Element * c = dynamic_cast<const xmlpp::Element *>(cs.front())) { boost::intrusive_ptr<VariableImpl> v; |