projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
No-op: remove all trailing whitespace.
[dcpomatic.git]
/
src
/
lib
/
cinema.cc
diff --git
a/src/lib/cinema.cc
b/src/lib/cinema.cc
index 43a4322396144417041ec801c380895f170079bf..f774392386b7136568b2dbe06e16b1f6e50f7654 100644
(file)
--- a/
src/lib/cinema.cc
+++ b/
src/lib/cinema.cc
@@
-17,14
+17,14
@@
*/
*/
-#include <libxml++/libxml++.h>
-#include <libcxml/cxml.h>
#include "cinema.h"
#include "cinema.h"
+#include <libcxml/cxml.h>
+#include <libxml++/libxml++.h>
using std::list;
using boost::shared_ptr;
using std::list;
using boost::shared_ptr;
-Cinema::Cinema (
shared_ptr<const cxml::Node>
node)
+Cinema::Cinema (
cxml::ConstNodePtr
node)
: name (node->string_child ("Name"))
, email (node->string_child ("Email"))
{
: name (node->string_child ("Name"))
, email (node->string_child ("Email"))
{
@@
-35,7
+35,7
@@
Cinema::Cinema (shared_ptr<const cxml::Node> node)
a constructor)
*/
void
a constructor)
*/
void
-Cinema::read_screens (
shared_ptr<const cxml::Node>
node)
+Cinema::read_screens (
cxml::ConstNodePtr
node)
{
list<cxml::NodePtr> s = node->node_children ("Screen");
for (list<cxml::NodePtr>::iterator i = s.begin(); i != s.end(); ++i) {
{
list<cxml::NodePtr> s = node->node_children ("Screen");
for (list<cxml::NodePtr>::iterator i = s.begin(); i != s.end(); ++i) {
@@
-67,17
+67,21
@@
Cinema::remove_screen (shared_ptr<Screen> s)
_screens.remove (s);
}
_screens.remove (s);
}
-Screen::Screen (shared_ptr<const cxml::Node> node)
+Screen::Screen (cxml::ConstNodePtr node)
+ : name (node->string_child ("Name"))
{
{
- name = node->string_child ("Name");
- certificate = shared_ptr<dcp::Certificate> (new dcp::Certificate (node->string_child ("Certificate")));
+ if (node->optional_string_child ("Certificate")) {
+ certificate = dcp::Certificate (node->string_child ("Certificate"));
+ }
}
void
Screen::as_xml (xmlpp::Element* parent) const
{
parent->add_child("Name")->add_child_text (name);
}
void
Screen::as_xml (xmlpp::Element* parent) const
{
parent->add_child("Name")->add_child_text (name);
- parent->add_child("Certificate")->add_child_text (certificate->certificate (true));
+ if (certificate) {
+ parent->add_child("Certificate")->add_child_text (certificate->certificate (true));
+ }
}
}
-
+