From f902811342bb9f72bb11e2658aea14cfe8b04c64 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 21 Aug 2012 16:00:16 +0100 Subject: Recursively scan font tags in subtitles. --- src/xml.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/xml.cc') diff --git a/src/xml.cc b/src/xml.cc index 0f0d2d47..08a43ea9 100644 --- a/src/xml.cc +++ b/src/xml.cc @@ -163,6 +163,17 @@ XMLNode::int64_attribute (string name) return lexical_cast (string_attribute (name)); } +int64_t +XMLNode::optional_int64_attribute (string name) +{ + string const s = string_attribute (name); + if (s.empty ()) { + return 0; + } + + return lexical_cast (s); +} + void XMLNode::done () { -- cgit v1.2.3