_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));
}
}
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));
}
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()) {
optional<string>
PKL::hash (string id) const
{
- for (auto i: _asset_list) {
+ for (auto i: _assets) {
if (i->id() == id) {
return i->hash();
}
optional<string>
PKL::type (string id) const
{
- for (auto i: _asset_list) {
+ for (auto i: _assets) {
if (i->id() == id) {
return i->type();
}
void
PKL::clear_assets()
{
- _asset_list.clear();
+ _assets.clear();
}
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;
};
}
}
- for (auto i: pkl->asset_list()) {
+ for (auto i: pkl->assets()) {
if (find(encrypted.begin(), encrypted.end(), i->id()) != encrypted.end()) {
return true;
}
/* 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()) {
}
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;