diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-01-14 21:49:40 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-01-14 21:49:40 +0000 |
| commit | 048f9b6b5569f03d1342a04f75c83a2bad340996 (patch) | |
| tree | 2e9db97154b82b91a7a6ff1002d317f35d11608d /src/lib | |
| parent | 3031638f0ddf23654b72af2088a7616791307310 (diff) | |
Various work on certificate handling for screens; need XML config here, now.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/cinema.h | 3 | ||||
| -rw-r--r-- | src/lib/config.cc | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/cinema.h b/src/lib/cinema.h index 0cec01384..6f426ae8d 100644 --- a/src/lib/cinema.h +++ b/src/lib/cinema.h @@ -3,8 +3,9 @@ class Screen { public: - Screen (std::string const & n) + Screen (std::string const & n, boost::shared_ptr<libdcp::Certificate> cert) : name (n) + , certificate (cert) {} std::string name; diff --git a/src/lib/config.cc b/src/lib/config.cc index 848e466a6..a74c36f73 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -50,6 +50,7 @@ Config::Config () string line; shared_ptr<Cinema> cinema; + shared_ptr<Screen> screen; while (getline (f, line)) { if (line.empty ()) { @@ -99,8 +100,15 @@ Config::Config () assert (cinema); cinema->email = v; } else if (k == "screen") { - shared_ptr<Screen> s (new Screen (v)); - cinema->screens.push_back (s); + assert (cinema); + if (screen) { + cinema->screens.push_back (screen); + } + screen.reset (new Screen (v, shared_ptr<libdcp::Certificate> ())); + } else if (k == "screen_certificate") { + assert (screen); + shared_ptr<Certificate> c (new libdcp::Certificate); + c->set_from_string (v); } } |
