Switch to testing on Ubuntu 16.04 and 22.04.
[libdcp.git] / src / asset_map.h
index cf91a95b88af6a44576214507fa901bd0daa03ed..d2a94f77aae9b2ee69f3a2762f61cc85aa8c1e56 100644 (file)
@@ -32,8 +32,8 @@
 */
 
 
+#include "asset_list.h"
 #include "object.h"
-#include "types.h"
 #include <libcxml/cxml.h>
 #include <boost/filesystem.hpp>
 #include <boost/optional.hpp>
 namespace dcp {
 
 
-class AssetMap : public Object
+class AssetMap : public Object, public AssetList
 {
 public:
        AssetMap(Standard standard, boost::optional<std::string> annotation_text, std::string issue_date, std::string issuer, std::string creator)
-               : _standard(standard)
-               , _annotation_text(annotation_text)
-               , _issue_date(issue_date)
-               , _issuer(issuer)
-               , _creator(creator)
-        {}
+               : AssetList(standard, annotation_text, issue_date, issuer, creator)
+       {}
 
        explicit AssetMap(boost::filesystem::path path);
 
-       boost::optional<boost::filesystem::path> path() const {
-               return _path;
+       boost::optional<boost::filesystem::path> file() const {
+               return _file;
        }
 
        std::map<std::string, boost::filesystem::path> asset_ids_and_paths() const;
 
        std::vector<boost::filesystem::path> pkl_paths() const;
 
-       dcp::Standard standard() const {
-               return _standard;
-       }
-
-       void set_annotation_text(std::string annotation_text) {
-               _annotation_text = annotation_text;
-       }
-
-       void set_issue_date(std::string issue_date) {
-               _issue_date = issue_date;
-       }
-
-       void set_issuer(std::string issuer) {
-               _issuer = issuer;
-       }
-
-       void set_creator(std::string creator) {
-               _creator = creator;
-       }
-
        void clear_assets();
        void add_asset(std::string id, boost::filesystem::path path, bool pkl);
 
@@ -116,14 +92,13 @@ public:
                bool _pkl = false;
        };
 
+       std::vector<Asset> assets() const {
+               return _assets;
+       }
+
 private:
-       dcp::Standard _standard;
-       boost::optional<std::string> _annotation_text;
-        std::string _issue_date;
-        std::string _issuer;
-        std::string _creator;
        std::vector<Asset> _assets;
-       mutable boost::optional<boost::filesystem::path> _path;
+       mutable boost::optional<boost::filesystem::path> _file;
 };