2 Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef LIBDCP_PACKAGE_BASE_H
21 #define LIBDCP_PACKAGE_BASE_H
23 #include "exceptions.h"
26 #include <boost/filesystem.hpp>
35 PackageBase (boost::filesystem::path directory);
37 typedef std::list<boost::shared_ptr<PackageReadError> > ReadErrors;
39 virtual std::list<boost::shared_ptr<Asset> > assets () const = 0;
43 virtual boost::shared_ptr<Asset> xml_asset_factory (boost::filesystem::path file, std::string root) const = 0;
44 virtual boost::shared_ptr<Asset> mxf_asset_factory (boost::filesystem::path file) const = 0;
46 std::list<boost::shared_ptr<Asset> > read_assetmap (bool keep_going, ReadErrors* errors) const;
48 void write_volindex (Standard standard) const;
50 /** Write the ASSETMAP file.
51 * @param pkl_uuid UUID of our PKL.
52 * @param pkl_length Length of our PKL in bytes.
54 void write_assetmap (Standard standard, std::string pkl_uuid, int pkl_length, XMLMetadata metadata) const;
56 /** the directory that the package is in */
57 boost::filesystem::path _directory;