From 8b89649074bcaca0f0b059a2b736de404262312d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 11 Sep 2022 00:10:22 +0200 Subject: Normalise XML attribute names to be camelCase (#2241). --- src/lib/util.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/lib/util.h') diff --git a/src/lib/util.h b/src/lib/util.h index acdc861ae..cf03423c7 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -32,6 +32,7 @@ #include "dcpomatic_time.h" #include "pixel_quanta.h" #include "types.h" +#include #include #include #include @@ -151,4 +152,15 @@ list_to_vector (std::list v) return l; } +template +T +number_attribute(cxml::ConstNodePtr node, std::string name1, std::string name2) +{ + auto value = node->optional_number_attribute(name1); + if (!value) { + value = node->number_attribute(name2); + } + return *value; +} + #endif -- cgit v1.2.3