summaryrefslogtreecommitdiff
path: root/src/dcp.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-04-25 10:26:11 +0200
committerCarl Hetherington <cth@carlh.net>2022-04-25 10:26:11 +0200
commit7c24b62d51e0ddf14af451ef5a543f07b69f111e (patch)
tree6628a7624fb554a4c8ee2ee561fa8228a0bde153 /src/dcp.h
parent764a1cc30404861757d9a99e7f0e20341d6ea353 (diff)
Move AssetMap handling out to a separate class.
Diffstat (limited to 'src/dcp.h')
-rw-r--r--src/dcp.h30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/dcp.h b/src/dcp.h
index a70ff8d1..48c36e7a 100644
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -41,6 +41,7 @@
#define LIBDCP_DCP_H
+#include "asset_map.h"
#include "certificate.h"
#include "compose.hpp"
#include "metadata.h"
@@ -163,7 +164,11 @@ public:
/** @return Standard of a DCP that was read in */
boost::optional<Standard> standard () const {
- return _standard;
+ if (!_asset_map) {
+ return {};
+ }
+
+ return _asset_map->standard();
}
boost::filesystem::path directory () const {
@@ -177,8 +182,12 @@ public:
return _pkls;
}
- boost::optional<boost::filesystem::path> asset_map_path () {
- return _asset_map;
+ boost::optional<boost::filesystem::path> asset_map_path() {
+ if (!_asset_map) {
+ return {};
+ }
+
+ return _asset_map->path();
}
static std::vector<boost::filesystem::path> directories_from_files (std::vector<boost::filesystem::path> files);
@@ -187,26 +196,13 @@ private:
void write_volindex (Standard standard) const;
- /** Write the ASSETMAP file.
- * @param pkl_uuid UUID of our PKL.
- * @param pkl_path Pathname of our PKL file.
- */
- void write_assetmap (
- Standard standard, std::string pkl_uuid, boost::filesystem::path pkl_path,
- std::string issuer, std::string creator, std::string issue_date, std::string annotation_text
- ) const;
-
/** The directory that we are writing to */
boost::filesystem::path _directory;
/** The CPLs that make up this DCP */
std::vector<std::shared_ptr<CPL>> _cpls;
/** The PKLs that make up this DCP */
std::vector<std::shared_ptr<PKL>> _pkls;
- /** File that the ASSETMAP was read from or last written to */
- mutable boost::optional<boost::filesystem::path> _asset_map;
-
- /** Standard of DCP that was read in */
- boost::optional<Standard> _standard;
+ boost::optional<AssetMap> _asset_map;
};