X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_kdm_cli.cc;h=f0097d7de38cd14b06256009d174ca60100f8a96;hb=9e7b4d64c4e9a9bcd0e08ede076162bb0ec666d1;hp=de89a9c7c2446f120c20f72ec5203a63e3a368e6;hpb=fbe2784c136fa1550815babfce89589f66b35a29;p=dcpomatic.git diff --git a/src/tools/dcpomatic_kdm_cli.cc b/src/tools/dcpomatic_kdm_cli.cc index de89a9c7c..f0097d7de 100644 --- a/src/tools/dcpomatic_kdm_cli.cc +++ b/src/tools/dcpomatic_kdm_cli.cc @@ -29,7 +29,6 @@ #include "lib/config.h" #include "lib/exceptions.h" #include "lib/emailer.h" -#include #include #include #include @@ -40,6 +39,7 @@ using std::cerr; using std::list; using std::vector; using boost::shared_ptr; +using boost::optional; static void help () @@ -82,10 +82,10 @@ time_from_string (string t) static boost::posix_time::time_duration duration_from_string (string d) { - locked_stringstream s (d); int N; - string unit; - s >> N >> unit; + char unit_buf[64] = "\0"; + sscanf (d.c_str(), "%d %63s", &N, unit_buf); + string const unit (unit_buf); if (N == 0) { cerr << "Could not understand duration \"" << d << "\"\n"; @@ -218,7 +218,7 @@ int main (int argc, char* argv[]) valid_to = valid_from.get() + duration_from_string (duration_string); } - string const film_dir = argv[optind]; + boost::filesystem::path const film_dir = argv[optind]; dcpomatic_setup_path_encoding (); dcpomatic_setup (); @@ -231,7 +231,7 @@ int main (int argc, char* argv[]) cout << "Read film " << film->name () << "\n"; } } catch (std::exception& e) { - cerr << program_name << ": error reading film `" << film_dir << "' (" << e.what() << ")\n"; + cerr << program_name << ": error reading film `" << film_dir.string() << "' (" << e.what() << ")\n"; exit (EXIT_FAILURE); }