From e61267217a8ca7e65ad42bf34b6488b92eca6389 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 1 Mar 2022 20:29:13 +0100 Subject: Make dcp::init() take a general resources directory rather than specifically tags. --- src/util.cc | 8 ++------ src/util.h | 9 +++++---- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/util.cc b/src/util.cc index 5133a43b..7a5733c2 100644 --- a/src/util.cc +++ b/src/util.cc @@ -170,7 +170,7 @@ dcp::empty_or_white_space (string s) void -dcp::init (optional tags_directory) +dcp::init (optional given_resources_directory) { if (xmlSecInit() < 0) { throw MiscError ("could not initialise xmlsec"); @@ -194,11 +194,7 @@ dcp::init (optional tags_directory) asdcp_smpte_dict = &ASDCP::DefaultSMPTEDict(); - if (!tags_directory) { - tags_directory = resources_directory() / "tags"; - } - - load_language_tag_lists (*tags_directory); + load_language_tag_lists (given_resources_directory.get_value_or(resources_directory()) / "tags"); } diff --git a/src/util.h b/src/util.h index 427ab427..89278f92 100644 --- a/src/util.h +++ b/src/util.h @@ -95,11 +95,12 @@ extern std::string remove_urn_uuid (std::string raw); /** Set up various bits that the library needs. Should be called once * by client applications. * - * @param tags_directory Path to a copy of the tags directory from the source code; - * if none is specified libdcp will look for a tags directory in the environment - * variable LIBDCP_RESOURCES or based on where the current executable is. + * @param resources_directory Path to a directory containing the tags and xsd + * directories from the source code; if none is specified libdcp will look + * in the directory given by LIBDCP_RESOURCES or based on where the current + * executable is. */ -extern void init (boost::optional tags_directory = boost::optional()); +extern void init (boost::optional resources_directory = boost::optional()); /** Decode a base64 string. The base64 decode routine in KM_util.cpp * gives different values to both this and the command-line base64 -- cgit v1.2.3