summaryrefslogtreecommitdiff
path: root/src/xml-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml-parser.c')
-rw-r--r--src/xml-parser.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/xml-parser.c b/src/xml-parser.c
index ee40dad..70c7528 100644
--- a/src/xml-parser.c
+++ b/src/xml-parser.c
@@ -210,6 +210,19 @@ xml_file_get_node_attribute_long (TXMLFile *file, const gchar *x_path, const gch
return i;
}
+gboolean
+xml_file_get_node_attribute_boolean (TXMLFile *file, const gchar *x_path, const gchar *attr, const gboolean _default)
+{
+ gchar *s;
+ gboolean b;
+
+ s = xml_file_get_node_attribute (file, x_path, attr);
+ b = s ? (strcasecmp (s, "yes") == 0 || strcasecmp (s, "true") == 0) : _default;
+ g_free (s);
+ return b;
+}
+
+
/*
* xml_file_get_node_present: existency test of the XPath node
*/