From 04def4c193777d7a6cbd306d0a3ba3944335e444 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 24 Aug 2016 11:16:08 +0100 Subject: Add new method. --- src/dcp.cc | 14 ++++++++++++++ src/dcp.h | 2 ++ 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/dcp.cc b/src/dcp.cc index fb0f2625..f99d3433 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -65,6 +65,7 @@ using std::string; using std::list; +using std::vector; using std::cout; using std::make_pair; using std::map; @@ -504,3 +505,16 @@ DCP::assets () const return assets; } + +/** Given a list of files that make up 1 or more DCPs, return the DCP directories */ +vector +DCP::directories_from_files (vector files) +{ + vector d; + BOOST_FOREACH (boost::filesystem::path i, files) { + if (i.filename() == "ASSETMAP" || i.filename() == "ASSETMAP.xml") { + d.push_back (i.parent_path ()); + } + } + return d; +} diff --git a/src/dcp.h b/src/dcp.h index e2919a38..3cd2c2cb 100644 --- a/src/dcp.h +++ b/src/dcp.h @@ -123,6 +123,8 @@ public: return _standard; } + static std::vector directories_from_files (std::vector files); + private: /** Write the PKL file. -- cgit v1.2.3