diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-08-21 16:13:22 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-08-21 16:13:22 +0100 |
| commit | b56b008e2ad86bd2c29a42390891a32ae658d6c4 (patch) | |
| tree | 1b40a20756da219dd495f1b67ecea37f8cccf8ce /src/xml.cc | |
| parent | f902811342bb9f72bb11e2658aea14cfe8b04c64 (diff) | |
Recurse into font nodes and pick up details of italics.
Diffstat (limited to 'src/xml.cc')
| -rw-r--r-- | src/xml.cc | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 () { |
