Add new write() method.
[libdcp.git] / tools / dcpdiff.cc
index 2bda4347ecf5816d700d7a42d9e14ede8d04ba02..1f76082958bf3e68a1f17f4b50ac03a6768a8896 100644 (file)
@@ -37,9 +37,8 @@
 #include "mxf.h"
 #include <getopt.h>
 #include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 #include <list>
 
@@ -47,9 +46,10 @@ using std::list;
 using std::cerr;
 using std::cout;
 using std::string;
-using boost::shared_ptr;
+using std::shared_ptr;
+using std::vector;
 using boost::optional;
-using boost::dynamic_pointer_cast;
+using std::dynamic_pointer_cast;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
@@ -82,7 +82,7 @@ help (string n)
 void
 note (NoteType t, string n)
 {
-       if (t == DCP_ERROR || verbose) {
+       if (t == NoteType::ERROR || verbose) {
                cout << " " << n << "\n";
                cout.flush ();
        }
@@ -95,17 +95,17 @@ load_dcp (boost::filesystem::path path, bool ignore_missing_assets, optional<str
        DCP* dcp = 0;
        try {
                dcp = new DCP (path);
-               list<dcp::VerificationNote> notes;
+               vector<dcp::VerificationNote> notes;
                dcp->read (&notes);
                filter_notes (notes, ignore_missing_assets);
-               BOOST_FOREACH (dcp::VerificationNote i, notes) {
+               for (auto i: notes) {
                        cerr << dcp::note_to_string(i) << "\n";
                }
 
                if (key) {
-                       list<shared_ptr<Asset> > assets = dcp->assets ();
-                       for (list<shared_ptr<Asset> >::const_iterator i = assets.begin(); i != assets.end(); ++i) {
-                               shared_ptr<MXF> mxf = dynamic_pointer_cast<MXF> (*i);
+                       auto assets = dcp->assets ();
+                       for (auto i: assets) {
+                               auto mxf = dynamic_pointer_cast<MXF>(i);
                                if (mxf) {
                                        mxf->set_key (Key (key.get ()));
                                }