Bump libdcp for ReelMXF API change.
[libsub.git] / tools / dumpsubs.cc
index 159af25e2f42a65c36701fa713085808c0d003cb..cf7008ee8aa16b8f3327728393b852d16484fb98 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2020 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
-#include <map>
-#include <getopt.h>
 #include "reader_factory.h"
 #include "reader.h"
+#include "collect.h"
+#include "util.h"
+#include <getopt.h>
+#include <boost/filesystem.hpp>
+#include <map>
+#include <iostream>
 
 using std::string;
 using std::cerr;
 using std::cout;
 using std::map;
-using boost::shared_ptr;
+using std::shared_ptr;
 using namespace sub;
 
 static void
@@ -63,7 +67,7 @@ main (int argc, char* argv[])
                exit (EXIT_FAILURE);
        }
 
-       if (access (argv[optind], F_OK) == -1) {
+       if (!boost::filesystem::exists (argv[optind])) {
                cerr << argv[0] << ": file " << argv[optind] << " not found.\n";
                exit (EXIT_FAILURE);
        }
@@ -74,10 +78,7 @@ main (int argc, char* argv[])
                exit (EXIT_FAILURE);
        }
 
-       map<string, string> metadata = reader->metadata ();
-       for (map<string, string>::const_iterator i = metadata.begin(); i != metadata.end(); ++i) {
-               cout << i->first << ": " << i->second << "\n";
-       }
+       sub::dump (reader, cout);
 
        return 0;
 }