#include "lib/config.h"
#include "lib/exceptions.h"
#include "lib/emailer.h"
-#include <locked_sstream.h>
#include <dcp/certificate.h>
#include <getopt.h>
#include <iostream>
using std::list;
using std::vector;
using boost::shared_ptr;
+using boost::optional;
static void
help ()
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";
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 ();
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);
}
}
dcp::NameFormat::Map values;
- values["film_name"] = film->name();
- values["from"] = dcp::LocalTime(valid_from.get()).date() + " " + dcp::LocalTime(valid_from.get()).time_of_day();
- values["to"] = dcp::LocalTime(valid_to.get()).date() + " " + dcp::LocalTime(valid_to.get()).time_of_day();
+ values['f'] = film->name();
+ values['b'] = dcp::LocalTime(valid_from.get()).date() + " " + dcp::LocalTime(valid_from.get()).time_of_day();
+ values['e'] = dcp::LocalTime(valid_to.get()).date() + " " + dcp::LocalTime(valid_to.get()).time_of_day();
try {
list<ScreenKDM> screen_kdms = film->make_kdms (