Check return value of fread in File::File.
[libdcp.git] / src / dcp.h
index e2919a38e768501bbc30e65d7033fd0eae7de3f5..b47daf556af6b28d527d739493f1c7aa268be55b 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -39,6 +39,7 @@
 #define LIBDCP_DCP_H
 
 #include "types.h"
+#include "util.h"
 #include "certificate.h"
 #include "metadata.h"
 #include "name_format.h"
@@ -56,6 +57,7 @@ namespace xmlpp {
 namespace dcp
 {
 
+class PKL;
 class Content;
 class Reel;
 class CPL;
@@ -103,7 +105,7 @@ public:
        void add (boost::shared_ptr<CPL> cpl);
 
        std::list<boost::shared_ptr<CPL> > cpls () const;
-       std::list<boost::shared_ptr<Asset> > assets () const;
+       std::list<boost::shared_ptr<Asset> > assets (bool ignore_unresolved = false) const;
 
        bool encrypted () const;
 
@@ -123,18 +125,20 @@ public:
                return _standard;
        }
 
-private:
+       boost::filesystem::path directory () const {
+               return _directory;
+       }
 
-       /** Write the PKL file.
-        *  @param pkl_uuid UUID to use.
+       /** @return PKLs if this DCP was read from an existing one, or if write_xml() has been called on it.
+        *  If neither is true, this method returns an empty list.
         */
-       boost::filesystem::path write_pkl (
-               std::string file,
-               Standard standard,
-               std::string pkl_uuid,
-               XMLMetadata metadata,
-               boost::shared_ptr<const CertificateChain> signer
-               ) const;
+       std::list<boost::shared_ptr<PKL> > pkls () const {
+               return _pkls;
+       }
+
+       static std::vector<boost::filesystem::path> directories_from_files (std::vector<boost::filesystem::path> files);
+
+private:
 
        void write_volindex (Standard standard) const;
 
@@ -148,6 +152,7 @@ private:
        boost::filesystem::path _directory;
        /** the CPLs that make up this DCP */
        std::list<boost::shared_ptr<CPL> > _cpls;
+       std::list<boost::shared_ptr<PKL> > _pkls;
 
        /** Standard of DCP that was read in */
        boost::optional<Standard> _standard;