diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-08-21 16:00:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-08-21 16:00:16 +0100 |
| commit | f902811342bb9f72bb11e2658aea14cfe8b04c64 (patch) | |
| tree | 542b519f20bca1aae38f6f77dbc3de895699bd9f /src/xml.cc | |
| parent | 3053ecfbb9d50a07593ebd4cebdb0de5ca0ca88e (diff) | |
Recursively scan font tags in subtitles.
Diffstat (limited to 'src/xml.cc')
| -rw-r--r-- | src/xml.cc | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -163,6 +163,17 @@ XMLNode::int64_attribute (string name) return lexical_cast<int64_t> (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<int64_t> (s); +} + void XMLNode::done () { |
