diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-04-27 01:50:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-04-29 22:51:18 +0100 |
| commit | 068291b7233b01573863d7fb5eda2a82883c748d (patch) | |
| tree | 1bca551006315fd234b2408e1be47fcd2970916d /src/lib | |
| parent | 1863fff137bda1c0d3702a845cc79afbfc8c74c4 (diff) | |
Add free-text notes field to cinemas and screens.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/cinema.cc | 3 | ||||
| -rw-r--r-- | src/lib/cinema.h | 6 | ||||
| -rw-r--r-- | src/lib/screen.cc | 7 | ||||
| -rw-r--r-- | src/lib/screen.h | 3 |
4 files changed, 14 insertions, 5 deletions
diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc index e9a7dce68..6e651dc76 100644 --- a/src/lib/cinema.cc +++ b/src/lib/cinema.cc @@ -32,6 +32,7 @@ using boost::shared_ptr; Cinema::Cinema (cxml::ConstNodePtr node) : name (node->string_child ("Name")) + , notes (node->optional_string_child("Notes").get_value_or("")) { BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Email")) { emails.push_back (i->content ()); @@ -67,6 +68,8 @@ Cinema::as_xml (xmlpp::Element* parent) const parent->add_child("Email")->add_child_text (i); } + parent->add_child("Notes")->add_child_text (notes); + parent->add_child("UTCOffsetHour")->add_child_text (dcp::raw_convert<string> (_utc_offset_hour)); parent->add_child("UTCOffsetMinute")->add_child_text (dcp::raw_convert<string> (_utc_offset_minute)); diff --git a/src/lib/cinema.h b/src/lib/cinema.h index 70508f233..db0c7fac7 100644 --- a/src/lib/cinema.h +++ b/src/lib/cinema.h @@ -39,9 +39,10 @@ class Screen; class Cinema : public boost::enable_shared_from_this<Cinema> { public: - Cinema (std::string const & n, std::list<std::string> const & e, int utc_offset_hour, int utc_offset_minute) - : name (n) + Cinema (std::string const & name_, std::list<std::string> const & e, std::string notes_, int utc_offset_hour, int utc_offset_minute) + : name (name_) , emails (e) + , notes (notes_) , _utc_offset_hour (utc_offset_hour) , _utc_offset_minute (utc_offset_minute) {} @@ -60,6 +61,7 @@ public: std::string name; std::list<std::string> emails; + std::string notes; int utc_offset_hour () const { return _utc_offset_hour; diff --git a/src/lib/screen.cc b/src/lib/screen.cc index 159c4326b..96a59236d 100644 --- a/src/lib/screen.cc +++ b/src/lib/screen.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,7 +22,8 @@ #include <boost/foreach.hpp> Screen::Screen (cxml::ConstNodePtr node) - : name (node->string_child ("Name")) + : name (node->string_child("Name")) + , notes (node->optional_string_child("Notes").get_value_or ("")) { if (node->optional_string_child ("Certificate")) { recipient = dcp::Certificate (node->string_child ("Certificate")); @@ -43,6 +44,8 @@ Screen::as_xml (xmlpp::Element* parent) const parent->add_child("Recipient")->add_child_text (recipient->certificate (true)); } + parent->add_child("Notes")->add_child_text (notes); + 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 0ae483544..5b875b388 100644 --- a/src/lib/screen.h +++ b/src/lib/screen.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,6 +45,7 @@ public: boost::shared_ptr<Cinema> cinema; std::string name; + std::string notes; boost::optional<dcp::Certificate> recipient; std::vector<dcp::Certificate> trusted_devices; }; |
