Add select-all.
[dcpomatic.git] / src / tools / dcpomatic_kdm_cli.cc
index b9f73d357e8f38b0fdb72f865d380c3c05b8f049..f21772a4d2d65d0fd8b10f6f300af51b28c463dd 100644 (file)
@@ -42,10 +42,10 @@ using std::cerr;
 using std::list;
 using std::vector;
 using std::runtime_error;
-using boost::shared_ptr;
+using std::shared_ptr;
 using boost::optional;
 using boost::bind;
-using boost::dynamic_pointer_cast;
+using std::dynamic_pointer_cast;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
@@ -226,7 +226,7 @@ from_film (
 
        try {
                list<KDMWithMetadataPtr> kdms;
-               BOOST_FOREACH (shared_ptr<Screen> i, screens) {
+               for (auto i: screens) {
                        KDMWithMetadataPtr p = kdm_for_screen (film, cpl, i, valid_from, valid_to, formulation, disable_forensic_marking_picture, disable_forensic_marking_audio);
                        if (p) {
                                kdms.push_back (p);
@@ -248,7 +248,7 @@ from_film (
 optional<dcp::EncryptedKDM>
 sub_find_dkdm (shared_ptr<DKDMGroup> group, string cpl_id)
 {
-       BOOST_FOREACH (shared_ptr<DKDMBase> i, group->children()) {
+       for (auto i: group->children()) {
                shared_ptr<DKDMGroup> g = dynamic_pointer_cast<DKDMGroup>(i);
                if (g) {
                        optional<dcp::EncryptedKDM> dkdm = sub_find_dkdm (g, cpl_id);
@@ -300,7 +300,7 @@ kdm_from_dkdm (
                dcp::LocalTime().as_string()
                );
 
-       BOOST_FOREACH (dcp::DecryptedKDMKey const & j, dkdm.keys()) {
+       for (auto const& j: dkdm.keys()) {
                kdm.add_key(j);
        }
 
@@ -327,7 +327,7 @@ from_dkdm (
 
        try {
                list<KDMWithMetadataPtr> kdms;
-               BOOST_FOREACH (shared_ptr<Screen> i, screens) {
+               for (auto i: screens) {
                        if (!i->recipient) {
                                continue;
                        }
@@ -354,7 +354,7 @@ from_dkdm (
                        name_values['e'] = end.date() + " " + end.time_of_day(true, false);
                        name_values['i'] = kdm.cpl_id();
 
-                       kdms.push_back (KDMWithMetadataPtr(new DCPKDMWithMetadata(name_values, i->cinema.get(), i->cinema->emails, kdm)));
+                       kdms.push_back (KDMWithMetadataPtr(new KDMWithMetadata(name_values, i->cinema.get(), i->cinema->emails, kdm)));
                }
                write_files (kdms, zip, output, container_name_format, filename_format, verbose);
        } catch (FileError& e) {
@@ -375,7 +375,7 @@ dump_dkdm_group (shared_ptr<DKDMGroup> group, int indent)
                }
                cout << group->name() << "\n";
        }
-       BOOST_FOREACH (shared_ptr<DKDMBase> i, group->children()) {
+       for (auto i: group->children()) {
                shared_ptr<DKDMGroup> g = dynamic_pointer_cast<DKDMGroup>(i);
                if (g) {
                        dump_dkdm_group (g, indent + 2);
@@ -407,7 +407,7 @@ int main (int argc, char* argv[])
        bool list_dkdm_cpls = false;
        optional<string> duration_string;
        bool verbose = false;
-       dcp::Formulation formulation = dcp::MODIFIED_TRANSITIONAL_1;
+       dcp::Formulation formulation = dcp::Formulation::MODIFIED_TRANSITIONAL_1;
        bool disable_forensic_marking_picture = false;
        optional<int> disable_forensic_marking_audio;
 
@@ -467,13 +467,13 @@ int main (int argc, char* argv[])
                        break;
                case 'F':
                        if (string (optarg) == "modified-transitional-1") {
-                               formulation = dcp::MODIFIED_TRANSITIONAL_1;
+                               formulation = dcp::Formulation::MODIFIED_TRANSITIONAL_1;
                        } else if (string (optarg) == "multiple-modified-transitional-1") {
-                               formulation = dcp::MULTIPLE_MODIFIED_TRANSITIONAL_1;
+                               formulation = dcp::Formulation::MULTIPLE_MODIFIED_TRANSITIONAL_1;
                        } else if (string (optarg) == "dci-any") {
-                               formulation = dcp::DCI_ANY;
+                               formulation = dcp::Formulation::DCI_ANY;
                        } else if (string (optarg) == "dci-specific") {
-                               formulation = dcp::DCI_SPECIFIC;
+                               formulation = dcp::Formulation::DCI_SPECIFIC;
                        } else {
                                error ("unrecognised KDM formulation " + string (optarg));
                        }
@@ -533,8 +533,8 @@ int main (int argc, char* argv[])
        }
 
        if (list_cinemas) {
-               list<boost::shared_ptr<Cinema> > cinemas = Config::instance()->cinemas ();
-               for (list<boost::shared_ptr<Cinema> >::const_iterator i = cinemas.begin(); i != cinemas.end(); ++i) {
+               list<std::shared_ptr<Cinema> > cinemas = Config::instance()->cinemas ();
+               for (list<std::shared_ptr<Cinema> >::const_iterator i = cinemas.begin(); i != cinemas.end(); ++i) {
                        cout << (*i)->name << " (" << Emailer::address_list ((*i)->emails) << ")\n";
                }
                exit (EXIT_SUCCESS);