summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-11-15 20:23:25 +0000
committerCarl Hetherington <cth@carlh.net>2015-11-15 20:23:25 +0000
commite170d9908c191180aefe71ff7cfa81a5ba08ed83 (patch)
treebfa566bcf3242500e030cc1bbed64a313846ffa8 /src/lib
parent3a67f024a614687a811ecb5c96a56fc664f04c3a (diff)
Save trusted devices.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/screen.cc9
-rw-r--r--src/lib/screen.h4
2 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/screen.cc b/src/lib/screen.cc
index 0876e770b..159c4326b 100644
--- a/src/lib/screen.cc
+++ b/src/lib/screen.cc
@@ -19,6 +19,7 @@
#include "screen.h"
#include <libxml++/libxml++.h>
+#include <boost/foreach.hpp>
Screen::Screen (cxml::ConstNodePtr node)
: name (node->string_child ("Name"))
@@ -28,6 +29,10 @@ Screen::Screen (cxml::ConstNodePtr node)
} else if (node->optional_string_child ("Recipient")) {
recipient = dcp::Certificate (node->string_child ("Recipient"));
}
+
+ BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children ("TrustedDevice")) {
+ trusted_devices.push_back (dcp::Certificate (i->content ()));
+ }
}
void
@@ -37,4 +42,8 @@ Screen::as_xml (xmlpp::Element* parent) const
if (recipient) {
parent->add_child("Recipient")->add_child_text (recipient->certificate (true));
}
+
+ BOOST_FOREACH (dcp::Certificate const & i, trusted_devices) {
+ parent->add_child("TrustedDevice")->add_child_text (i.certificate (true));
+ }
}
diff --git a/src/lib/screen.h b/src/lib/screen.h
index 6e3b8b01d..0ae483544 100644
--- a/src/lib/screen.h
+++ b/src/lib/screen.h
@@ -33,9 +33,10 @@ class Cinema;
class Screen
{
public:
- Screen (std::string const & n, boost::optional<dcp::Certificate> rec)
+ Screen (std::string const & n, boost::optional<dcp::Certificate> rec, std::vector<dcp::Certificate> td)
: name (n)
, recipient (rec)
+ , trusted_devices (td)
{}
Screen (cxml::ConstNodePtr);
@@ -45,4 +46,5 @@ public:
boost::shared_ptr<Cinema> cinema;
std::string name;
boost::optional<dcp::Certificate> recipient;
+ std::vector<dcp::Certificate> trusted_devices;
};