40 #ifndef LIBDCP_ASSET_H
41 #define LIBDCP_ASSET_H
46 #include <boost/filesystem.hpp>
47 #include <boost/function.hpp>
48 #include <boost/optional.hpp>
63 class EqualityOptions;
81 explicit Asset (boost::filesystem::path
file);
87 Asset (std::string
id, boost::filesystem::path
file);
90 std::shared_ptr<const Asset> other,
95 virtual void add_to_assetmap (
AssetMap& asset_map, boost::filesystem::path root)
const;
97 virtual void add_to_pkl (std::shared_ptr<PKL> pkl, boost::filesystem::path root)
const;
100 boost::optional<boost::filesystem::path>
file ()
const {
135 std::string
hash(boost::function<
void (int64_t, int64_t)> progress = {})
const;
137 void set_hash (std::string
hash);
143 mutable boost::optional<boost::filesystem::path>
_file;
145 static void add_file_to_assetmap (
AssetMap& asset_map, boost::filesystem::path root, boost::filesystem::path
file, std::string
id);
148 friend struct ::asset_test;
151 virtual std::string
pkl_type (Standard standard)
const = 0;
154 mutable boost::optional<std::string>
_hash;
Parent class for DCP assets, i.e. picture, sound, subtitles, closed captions, CPLs,...
virtual std::string pkl_type(Standard standard) const =0
boost::optional< boost::filesystem::path > file() const
boost::optional< boost::filesystem::path > _file
void set_file_preserving_hash(boost::filesystem::path file) const
boost::optional< std::string > _hash
std::string hash(boost::function< void(int64_t, int64_t)> progress={}) const
void set_file(boost::filesystem::path file) const
void rename_file(boost::filesystem::path file)
A class to describe what "equality" means for a particular test.
Some part of a DCP that has a UUID.
Namespace for everything in libdcp.