summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-01 21:19:51 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-07 22:46:21 +0100
commit05e0890d4bb991fc321ac2e11993eba37d20e077 (patch)
treec014fb6294b5516c680832288552d86f05b1af63 /src
parent38bf41a1b3fc0228ea44f69b2f145a7fa2a9aabb (diff)
Cleanup: rename PKL::asset_list -> assets for consistency.
Diffstat (limited to 'src')
-rw-r--r--src/pkl.cc12
-rw-r--r--src/pkl.h6
-rw-r--r--src/verify.cc6
3 files changed, 12 insertions, 12 deletions
diff --git a/src/pkl.cc b/src/pkl.cc
index 9ba716fb..eb8ca867 100644
--- a/src/pkl.cc
+++ b/src/pkl.cc
@@ -81,7 +81,7 @@ PKL::PKL (boost::filesystem::path file)
_creator = pkl.string_child ("Creator");
for (auto i: pkl.node_child("AssetList")->node_children("Asset")) {
- _asset_list.push_back (make_shared<Asset>(i));
+ _assets.push_back(make_shared<Asset>(i));
}
}
@@ -89,7 +89,7 @@ PKL::PKL (boost::filesystem::path file)
void
PKL::add_asset(std::string id, boost::optional<std::string> annotation_text, std::string hash, int64_t size, std::string type, std::string original_filename)
{
- _asset_list.push_back(make_shared<Asset>(id, annotation_text, hash, size, type, original_filename));
+ _assets.push_back(make_shared<Asset>(id, annotation_text, hash, size, type, original_filename));
}
@@ -113,7 +113,7 @@ PKL::write_xml (boost::filesystem::path file, shared_ptr<const CertificateChain>
pkl->add_child("Creator")->add_child_text (_creator);
auto asset_list = pkl->add_child("AssetList");
- for (auto i: _asset_list) {
+ for (auto i: _assets) {
auto asset = asset_list->add_child("Asset");
asset->add_child("Id")->add_child_text ("urn:uuid:" + i->id());
if (i->annotation_text()) {
@@ -141,7 +141,7 @@ PKL::write_xml (boost::filesystem::path file, shared_ptr<const CertificateChain>
optional<string>
PKL::hash (string id) const
{
- for (auto i: _asset_list) {
+ for (auto i: _assets) {
if (i->id() == id) {
return i->hash();
}
@@ -154,7 +154,7 @@ PKL::hash (string id) const
optional<string>
PKL::type (string id) const
{
- for (auto i: _asset_list) {
+ for (auto i: _assets) {
if (i->id() == id) {
return i->type();
}
@@ -167,5 +167,5 @@ PKL::type (string id) const
void
PKL::clear_assets()
{
- _asset_list.clear();
+ _assets.clear();
}
diff --git a/src/pkl.h b/src/pkl.h
index 8a1d07f9..daab4b26 100644
--- a/src/pkl.h
+++ b/src/pkl.h
@@ -123,12 +123,12 @@ public:
boost::optional<std::string> _original_filename;
};
- std::vector<std::shared_ptr<Asset>> asset_list () const {
- return _asset_list;
+ std::vector<std::shared_ptr<Asset>> assets() const {
+ return _assets;
}
private:
- std::vector<std::shared_ptr<Asset>> _asset_list;
+ std::vector<std::shared_ptr<Asset>> _assets;
/** The most recent disk file used to read or write this PKL */
mutable boost::optional<boost::filesystem::path> _file;
};
diff --git a/src/verify.cc b/src/verify.cc
index 3c5d180a..c8009741 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -1248,7 +1248,7 @@ pkl_has_encrypted_assets(shared_ptr<const DCP> dcp, shared_ptr<const PKL> pkl)
}
}
- for (auto i: pkl->asset_list()) {
+ for (auto i: pkl->assets()) {
if (find(encrypted.begin(), encrypted.end(), i->id()) != encrypted.end()) {
return true;
}
@@ -1450,7 +1450,7 @@ verify_cpl(
/* Check that any PKL with a single CPL has its AnnotationText the same as the CPL's ContentTitleText */
optional<string> required_annotation_text;
- for (auto j: i->asset_list()) {
+ for (auto j: i->assets()) {
/* See if this is a CPL */
for (auto k: dcp->cpls()) {
if (j->id() == k->id()) {
@@ -1628,7 +1628,7 @@ verify_pkl(
}
set<string> uuid_set;
- for (auto asset: pkl->asset_list()) {
+ for (auto asset: pkl->assets()) {
if (!uuid_set.insert(asset->id()).second) {
notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::DUPLICATE_ASSET_ID_IN_PKL, pkl->id(), pkl->file().get()});
break;