summaryrefslogtreecommitdiff
path: root/src/xml.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-08-21 16:13:22 +0100
committerCarl Hetherington <cth@carlh.net>2012-08-21 16:13:22 +0100
commitb56b008e2ad86bd2c29a42390891a32ae658d6c4 (patch)
tree1b40a20756da219dd495f1b67ecea37f8cccf8ce /src/xml.cc
parentf902811342bb9f72bb11e2658aea14cfe8b04c64 (diff)
Recurse into font nodes and pick up details of italics.
Diffstat (limited to 'src/xml.cc')
-rw-r--r--src/xml.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/xml.cc b/src/xml.cc
index 08a43ea9..bc42ebce 100644
--- a/src/xml.cc
+++ b/src/xml.cc
@@ -174,6 +174,21 @@ XMLNode::optional_int64_attribute (string name)
return lexical_cast<int64_t> (s);
}
+optional<bool>
+XMLNode::optional_bool_attribute (string name)
+{
+ string const s = string_attribute (name);
+ if (s.empty ()) {
+ return optional<bool> ();
+ }
+
+ if (s == "1" || s == "yes") {
+ return optional<bool> (true);
+ }
+
+ return optional<bool> (false);
+}
+
void
XMLNode::done ()
{