}
}
+/** @return full pathname of PKL file that was written */
boost::filesystem::path
DCP::write_pkl (string file, Standard standard, string pkl_uuid, XMLMetadata metadata, shared_ptr<const CertificateChain> signer) const
{
}
void
-DCP::write_assetmap (Standard standard, string pkl_uuid, int pkl_length, XMLMetadata metadata) const
+DCP::write_assetmap (Standard standard, string pkl_uuid, boost::filesystem::path pkl_path, XMLMetadata metadata) const
{
boost::filesystem::path p = _directory;
asset->add_child("PackingList")->add_child_text ("true");
xmlpp::Node* chunk_list = asset->add_child ("ChunkList");
xmlpp::Node* chunk = chunk_list->add_child ("Chunk");
- chunk->add_child("Path")->add_child_text ("pkl_" + pkl_uuid + ".xml");
+ chunk->add_child("Path")->add_child_text (pkl_path.filename().string());
chunk->add_child("VolumeIndex")->add_child_text ("1");
chunk->add_child("Offset")->add_child_text ("0");
- chunk->add_child("Length")->add_child_text (raw_convert<string> (pkl_length));
+ chunk->add_child("Length")->add_child_text (raw_convert<string> (boost::filesystem::file_size (pkl_path)));
BOOST_FOREACH (shared_ptr<Asset> i, assets ()) {
i->write_to_assetmap (asset_list, _directory);
boost::filesystem::path const pkl_path = write_pkl (name_format.get(values) + ".xml", standard, pkl_uuid, metadata, signer);
write_volindex (standard);
- write_assetmap (standard, pkl_uuid, boost::filesystem::file_size (pkl_path), metadata);
+ write_assetmap (standard, pkl_uuid, pkl_path, metadata);
}
list<shared_ptr<CPL> >
/** Write the ASSETMAP file.
* @param pkl_uuid UUID of our PKL.
- * @param pkl_length Length of our PKL in bytes.
+ * @param pkl_path Pathname of our PKL file.
*/
- void write_assetmap (Standard standard, std::string pkl_uuid, int pkl_length, XMLMetadata metadata) const;
+ void write_assetmap (Standard standard, std::string pkl_uuid, boost::filesystem::path pkl_path, XMLMetadata metadata) const;
/** the directory that we are writing to */
boost::filesystem::path _directory;