Add headerpad option for the macOS linker.
[libdcp.git] / tools / dcpinfo.cc
index 28b67a8dd9712f2bb581f1714c671c4b349609c3..c85198587947ce876f73bbace97ccafae09a7af4 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
@@ -52,7 +52,6 @@
 #include "compose.hpp"
 #include <getopt.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
 #include <cstdlib>
@@ -143,7 +142,7 @@ main_picture (vector<string> const& only, shared_ptr<Reel> reel, bool analyse, b
                OUTPUT_PICTURE(
                        " duration %1 (%2) intrinsic %3",
                        *mp->duration(),
-                       dcp::Time(*mp->duration(), mp->frame_rate().as_float(), mp->frame_rate().as_float()).as_string(dcp::SMPTE),
+                       dcp::Time(*mp->duration(), mp->frame_rate().as_float(), mp->frame_rate().as_float()).as_string(dcp::Standard::SMPTE),
                        mp->intrinsic_duration()
                        );
        } else {
@@ -248,7 +247,7 @@ main_subtitle (vector<string> const& only, shared_ptr<Reel> reel, bool list_subt
        OUTPUT_SUBTITLE("      Subtitle ID: %1", ms->id());
 
        if (ms->asset_ref().resolved()) {
-               list<shared_ptr<Subtitle> > subs = ms->asset()->subtitles ();
+               auto subs = ms->asset()->subtitles ();
                OUTPUT_SUBTITLE("\n      Subtitle:    %1 subtitles", subs.size());
                shared_ptr<InteropSubtitleAsset> iop = dynamic_pointer_cast<InteropSubtitleAsset> (ms->asset());
                if (iop) {
@@ -259,14 +258,14 @@ main_subtitle (vector<string> const& only, shared_ptr<Reel> reel, bool list_subt
                        OUTPUT_SUBTITLE(" in %1\n", smpte->language().get());
                }
                if (list_subtitles) {
-                       BOOST_FOREACH (shared_ptr<Subtitle> k, subs) {
-                               shared_ptr<SubtitleString> ks = dynamic_pointer_cast<SubtitleString> (k);
+                       for (auto k: subs) {
+                               auto ks = dynamic_pointer_cast<const SubtitleString>(k);
                                if (ks) {
                                        stringstream s;
                                        s << *ks;
                                        OUTPUT_SUBTITLE("%1\n", s.str());
                                }
-                               shared_ptr<SubtitleImage> is = dynamic_pointer_cast<SubtitleImage> (k);
+                               auto is = dynamic_pointer_cast<const SubtitleImage>(k);
                                if (is) {
                                        stringstream s;
                                        s << *is;
@@ -360,10 +359,10 @@ main (int argc, char* argv[])
                only = boost::split(only, *only_string, boost::is_any_of(","));
        }
 
-       list<shared_ptr<CPL> > cpls;
+       vector<shared_ptr<CPL> > cpls;
        if (boost::filesystem::is_directory(argv[optind])) {
                DCP* dcp = 0;
-               list<dcp::VerificationNote> notes;
+               vector<dcp::VerificationNote> notes;
                try {
                        dcp = new DCP (argv[optind]);
                        dcp->read (&notes);
@@ -384,7 +383,7 @@ main (int argc, char* argv[])
                OUTPUT_DCP_PATH("DCP: %1\n", boost::filesystem::path(argv[optind]).string());
 
                dcp::filter_notes (notes, ignore_missing_assets);
-               BOOST_FOREACH (dcp::VerificationNote i, notes) {
+               for (auto i: notes) {
                        cerr << "Error: " << note_to_string(i) << "\n";
                }
 
@@ -396,11 +395,11 @@ main (int argc, char* argv[])
 
        dcp::Time total_time;
 
-       BOOST_FOREACH (shared_ptr<CPL> i, cpls) {
-               OUTPUT_CPL_NAME_ID("  CPL: %1 %2\n", i->annotation_text(), i->id());
+       for (auto i: cpls) {
+               OUTPUT_CPL_NAME_ID("  CPL: %1 %2\n", i->annotation_text().get_value_or(""), i->id());
 
                int R = 1;
-               BOOST_FOREACH (shared_ptr<Reel> j, i->reels()) {
+               for (auto j: i->reels()) {
                        if (should_output(only, "picture") || should_output(only, "sound") || should_output(only, "subtitle")) {
                                cout << "    Reel " << R << "\n";
                        }
@@ -433,7 +432,7 @@ main (int argc, char* argv[])
                }
        }
 
-       OUTPUT_TOTAL_TIME("Total: %1\n", total_time.as_string(dcp::SMPTE));
+       OUTPUT_TOTAL_TIME("Total: %1\n", total_time.as_string(dcp::Standard::SMPTE));
 
        return 0;
 }