projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Basic template support (#485).
[dcpomatic.git]
/
src
/
tools
/
dcpomatic_kdm_cli.cc
diff --git
a/src/tools/dcpomatic_kdm_cli.cc
b/src/tools/dcpomatic_kdm_cli.cc
index 38808596ec25f01605fc0d48217e44823388fa6d..f0097d7de38cd14b06256009d174ca60100f8a96 100644
(file)
--- 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 "lib/config.h"
#include "lib/exceptions.h"
#include "lib/emailer.h"
-#include <locked_sstream.h>
#include <dcp/certificate.h>
#include <getopt.h>
#include <iostream>
#include <dcp/certificate.h>
#include <getopt.h>
#include <iostream>
@@
-40,6
+39,7
@@
using std::cerr;
using std::list;
using std::vector;
using boost::shared_ptr;
using std::list;
using std::vector;
using boost::shared_ptr;
+using boost::optional;
static void
help ()
static void
help ()
@@
-82,10
+82,10
@@
time_from_string (string t)
static boost::posix_time::time_duration
duration_from_string (string d)
{
static boost::posix_time::time_duration
duration_from_string (string d)
{
- locked_stringstream s (d);
int N;
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";
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);
}
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 ();
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) {
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);
}
exit (EXIT_FAILURE);
}
@@
-285,9
+285,9
@@
int main (int argc, char* argv[])
}
dcp::NameFormat::Map values;
}
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 (
try {
list<ScreenKDM> screen_kdms = film->make_kdms (