From b56b008e2ad86bd2c29a42390891a32ae658d6c4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 21 Aug 2012 16:13:22 +0100 Subject: Recurse into font nodes and pick up details of italics. --- src/xml.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/xml.cc') 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 (s); } +optional +XMLNode::optional_bool_attribute (string name) +{ + string const s = string_attribute (name); + if (s.empty ()) { + return optional (); + } + + if (s == "1" || s == "yes") { + return optional (true); + } + + return optional (false); +} + void XMLNode::done () { -- cgit v1.2.3