[glom/libxml++-3.0] Use libxml++-3.0.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/libxml++-3.0] Use libxml++-3.0.
- Date: Fri, 18 Sep 2015 08:46:28 +0000 (UTC)
commit bbc91f7f78676b76de99257e69d4682201793787
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Sep 18 10:46:02 2015 +0200
Use libxml++-3.0.
configure.ac | 2 +-
glom/libglom/xml_utils.cc | 12 +++++++++---
glom/libglom/xml_utils.h | 4 +++-
3 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d590041..58ba44a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,7 +159,7 @@ AS_IF([test "x$glom_enable_postgresql" = xyes],
# Libraries used by libglom:
-REQUIRED_LIBGLOM_LIBS='giomm-2.4 >= 2.43.1 libxml++-2.6 >= 2.23.1 libxslt >= 1.1.10 pygobject-3.0 >= 2.29.0
libgdamm-5.0 >= 4.99.8 libgda-5.0 >= 5.2.1 libgda-postgres-5.0 libgda-postgres-5.0 libgda-mysql-5.0
libarchive >= 3.0'
+REQUIRED_LIBGLOM_LIBS='giomm-2.4 >= 2.43.1 libxml++-3.0 >= 2.23.1 libxslt >= 1.1.10 pygobject-3.0 >= 2.29.0
libgdamm-5.0 >= 4.99.8 libgda-5.0 >= 5.2.1 libgda-postgres-5.0 libgda-postgres-5.0 libgda-mysql-5.0
libarchive >= 3.0'
AS_IF([test "x$glom_host_win32" != xyes],
[REQUIRED_LIBGLOM_LIBS="$REQUIRED_LIBGLOM_LIBS libepc-1.0 >= 0.4.0"])
diff --git a/glom/libglom/xml_utils.cc b/glom/libglom/xml_utils.cc
index 6ea99e0..85d0950 100644
--- a/glom/libglom/xml_utils.cc
+++ b/glom/libglom/xml_utils.cc
@@ -61,9 +61,15 @@ void set_node_attribute_value(xmlpp::Element* node, const Glib::ustring& strAttr
}
}
-xmlpp::Element* get_node_child_named(const xmlpp::Element* node, const Glib::ustring& strName)
+xmlpp::Element* get_node_child_named(xmlpp::Element* node, const Glib::ustring& strName)
{
- xmlpp::Element* nodeResult = nullptr;
+ auto result = get_node_child_named(const_cast<const xmlpp::Element*>(node), strName);
+ return const_cast<xmlpp::Element*>(result);
+}
+
+const xmlpp::Element* get_node_child_named(const xmlpp::Element* node, const Glib::ustring& strName)
+{
+ const xmlpp::Element* nodeResult = nullptr;
if(node)
{
@@ -74,7 +80,7 @@ xmlpp::Element* get_node_child_named(const xmlpp::Element* node, const Glib::ust
//as well as Elements with the name "text".
for(const auto& item : list)
{
- nodeResult = dynamic_cast<xmlpp::Element*>(item);
+ nodeResult = dynamic_cast<const xmlpp::Element*>(item);
if(nodeResult)
return nodeResult;
}
diff --git a/glom/libglom/xml_utils.h b/glom/libglom/xml_utils.h
index d09210c..e96ac83 100644
--- a/glom/libglom/xml_utils.h
+++ b/glom/libglom/xml_utils.h
@@ -34,7 +34,9 @@ namespace XmlUtils
Glib::ustring get_node_attribute_value(const xmlpp::Element* node, const Glib::ustring& strAttributeName);
void set_node_attribute_value(xmlpp::Element* node, const Glib::ustring& strAttributeName, const
Glib::ustring& strValue);
-xmlpp::Element* get_node_child_named(const xmlpp::Element* node, const Glib::ustring& strName);
+xmlpp::Element* get_node_child_named(xmlpp::Element* node, const Glib::ustring& strName);
+const xmlpp::Element* get_node_child_named(const xmlpp::Element* node, const Glib::ustring& strName);
+
xmlpp::Element* get_node_child_named_with_add(xmlpp::Element* node, const Glib::ustring& strName);
/// If the attribute is not there, then the default will be returned.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]