Cleanup: rename AssetMap::path -> file for consistency.
authorCarl Hetherington <cth@carlh.net>
Sun, 1 Jan 2023 20:27:16 +0000 (21:27 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 7 Jan 2023 21:46:32 +0000 (22:46 +0100)
src/asset_map.cc
src/asset_map.h
src/dcp.h
src/verify.cc

index 4b6d828ca57bf771c1b007a9d0058565feb6f01b..c1bafd92788006fa8d321625eeef1d9dc1663559 100644 (file)
@@ -55,12 +55,12 @@ static string const assetmap_interop_ns = "http://www.digicine.com/PROTO-ASDCP-A
 static string const assetmap_smpte_ns   = "http://www.smpte-ra.org/schemas/429-9/2007/AM";
 
 
-AssetMap::AssetMap(boost::filesystem::path path)
-       : _path(path)
+AssetMap::AssetMap(boost::filesystem::path file)
+       : _file(file)
 {
        cxml::Document doc("AssetMap");
 
-       doc.read_file(path);
+       doc.read_file(file);
        if (doc.namespace_uri() == assetmap_interop_ns) {
                _standard = Standard::INTEROP;
        } else if (doc.namespace_uri() == assetmap_smpte_ns) {
@@ -76,7 +76,7 @@ AssetMap::AssetMap(boost::filesystem::path path)
         _creator = doc.string_child("Creator");
 
        for (auto asset: doc.node_child("AssetList")->node_children("Asset")) {
-                _assets.push_back(Asset(asset, _path->parent_path(), _standard));
+                _assets.push_back(Asset(asset, _file->parent_path(), _standard));
         }
 }
 
@@ -148,7 +148,7 @@ AssetMap::pkl_paths() const
 
 
 void
-AssetMap::write_xml(boost::filesystem::path path) const
+AssetMap::write_xml(boost::filesystem::path file) const
 {
        xmlpp::Document doc;
        xmlpp::Element* root;
@@ -188,11 +188,11 @@ AssetMap::write_xml(boost::filesystem::path path) const
 
        auto asset_list = root->add_child("AssetList");
        for (auto const& asset: _assets) {
-               asset.write_xml(asset_list, path.parent_path());
+               asset.write_xml(asset_list, file.parent_path());
        }
 
-       doc.write_to_file_formatted(path.string(), "UTF-8");
-       _path = path;
+       doc.write_to_file_formatted(file.string(), "UTF-8");
+       _file = file;
 }
 
 
index 5238b96b9670e71f9d218a2c4dbe4e3bb52cf3b5..dcd0f961124836769e54919a0196f54c542c5265 100644 (file)
@@ -54,8 +54,8 @@ public:
 
        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;
@@ -99,7 +99,7 @@ public:
 
 private:
        std::vector<Asset> _assets;
-       mutable boost::optional<boost::filesystem::path> _path;
+       mutable boost::optional<boost::filesystem::path> _file;
 };
 
 
index 941df67cad91d793c0a339bbd640ee463481d84b..7d3d670aa891a4e35e20ea2736d059f70554d64d 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -182,12 +182,12 @@ public:
                return _pkls;
        }
 
-       boost::optional<boost::filesystem::path> asset_map_path() const {
+       boost::optional<boost::filesystem::path> asset_map_file() const {
                if (!_asset_map) {
                        return {};
                }
 
-               return _asset_map->path();
+               return _asset_map->file();
        }
 
        boost::optional<AssetMap> asset_map() const {
index c8009741e91adbce184a33677bb5076a79bd0fc7..bfa697dae21bf6aa1ae40243c182bd86a6f8e8fa 100644 (file)
@@ -1649,12 +1649,12 @@ verify_assetmap(
        auto asset_map = dcp->asset_map();
        DCP_ASSERT(asset_map);
 
-       validate_xml(asset_map->path().get(), xsd_dtd_directory, notes);
+       validate_xml(asset_map->file().get(), xsd_dtd_directory, notes);
 
        set<string> uuid_set;
        for (auto const& asset: asset_map->assets()) {
                if (!uuid_set.insert(asset.id()).second) {
-                       notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP, asset_map->id(), asset_map->path().get()});
+                       notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP, asset_map->id(), asset_map->file().get()});
                        break;
                }
        }
@@ -1725,8 +1725,8 @@ dcp::verify (
                        verify_pkl(dcp, pkl, *xsd_dtd_directory, notes);
                }
 
-               if (dcp->asset_map_path()) {
-                       stage ("Checking ASSETMAP", dcp->asset_map_path().get());
+               if (dcp->asset_map_file()) {
+                       stage("Checking ASSETMAP", dcp->asset_map_file().get());
                        verify_assetmap(dcp, *xsd_dtd_directory, notes);
                } else {
                        notes.push_back ({VerificationNote::Type::ERROR, VerificationNote::Code::MISSING_ASSETMAP});