Add a somewhat dubious constructor.
[libdcp.git] / src / asset.h
index 0c8df0c85b6621022b627394e3678125639fd69d..5436e05cde27f76f7afdc178f1477e11ec5e00e4 100644 (file)
 #define LIBDCP_ASSET_H
 
 #include <string>
+#include <list>
 #include <boost/filesystem.hpp>
-#include <sigc++/sigc++.h>
 #include "types.h"
 
 namespace ASDCP {
        class WriterInfo;
 }
 
+namespace xmlpp {
+       class Element;
+}
+
 namespace libdcp
 {
 
@@ -45,26 +49,32 @@ class Asset
 public:
        /** Construct an Asset.
         *  @param directory Directory where our XML or MXF file is.
-        *  @param file_name Name of our file within directory.
+        *  @param file_name Name of our file within directory, or empty to make one up based on UUID.
         */
-       Asset (std::string directory, std::string file_name);
+       Asset (std::string directory, std::string file_name = "");
 
-       /** Write details of the asset to a CPL stream.
-        *  @param s Stream.
+       virtual ~Asset() {}
+
+       /** Write details of the asset to a CPL AssetList node.
+        *  @param p Parent node.
         */
-       virtual void write_to_cpl (std::ostream& s) const = 0;
+       virtual void write_to_cpl (xmlpp::Element* p) const = 0;
 
-       /** Write details of the asset to a PKL stream.
-        *  @param s Stream.
+       /** Write details of the asset to a PKL AssetList node.
+        *  @param p Parent node.
         */
-       void write_to_pkl (std::ostream& s) const;
+       void write_to_pkl (xmlpp::Element* p) const;
 
        /** Write details of the asset to a ASSETMAP stream.
         *  @param s Stream.
         */
        void write_to_assetmap (std::ostream& s) const;
 
-       virtual std::list<std::string> equals (boost::shared_ptr<const Asset> other, EqualityOptions opt) const = 0;
+       std::string uuid () const {
+               return _uuid;
+       }
+
+       virtual bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, std::list<std::string>& notes) const = 0;
 
 protected:
        friend class PictureAsset;