summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-30 00:28:33 +0200
committerCarl Hetherington <cth@carlh.net>2020-05-03 22:34:22 +0200
commitb0c11dce0d5a37122d7a1126a330ff7f16f8c9bb (patch)
treed018f27e65eeeaa358a3a19f48ab4662f8ced6e1 /src
parent4ead1f24f97edde9b6a77e47947cb188a551b49b (diff)
Move TrustedDevice to its own source files.
Diffstat (limited to 'src')
-rw-r--r--src/lib/screen.cc31
-rw-r--r--src/lib/screen.h19
-rw-r--r--src/lib/trusted_device.cc56
-rw-r--r--src/lib/trusted_device.h46
-rw-r--r--src/lib/wscript1
5 files changed, 104 insertions, 49 deletions
diff --git a/src/lib/screen.cc b/src/lib/screen.cc
index fe62a5e6c..2453e1eaf 100644
--- a/src/lib/screen.cc
+++ b/src/lib/screen.cc
@@ -71,34 +71,3 @@ Screen::trusted_device_thumbprints () const
return t;
}
-TrustedDevice::TrustedDevice (string thumbprint)
- : _thumbprint (thumbprint)
-{
-
-}
-
-TrustedDevice::TrustedDevice (dcp::Certificate certificate)
- : _certificate (certificate)
-{
-
-}
-
-string
-TrustedDevice::as_string () const
-{
- if (_certificate) {
- return _certificate->certificate(true);
- }
-
- return *_thumbprint;
-}
-
-string
-TrustedDevice::thumbprint () const
-{
- if (_certificate) {
- return _certificate->thumbprint ();
- }
-
- return *_thumbprint;
-}
diff --git a/src/lib/screen.h b/src/lib/screen.h
index 40990b684..abc229ec6 100644
--- a/src/lib/screen.h
+++ b/src/lib/screen.h
@@ -21,6 +21,7 @@
#ifndef DCPOMATIC_SCREEN_H
#define DCPOMATIC_SCREEN_H
+#include "trusted_device.h"
#include <dcp/certificate.h>
#include <libcxml/cxml.h>
#include <boost/optional.hpp>
@@ -28,24 +29,6 @@
class Cinema;
-class TrustedDevice
-{
-public:
- explicit TrustedDevice (std::string);
- explicit TrustedDevice (dcp::Certificate);
-
- boost::optional<dcp::Certificate> certificate () const {
- return _certificate;
- }
-
- std::string thumbprint () const;
- std::string as_string () const;
-
-private:
- boost::optional<dcp::Certificate> _certificate;
- boost::optional<std::string> _thumbprint;
-};
-
namespace dcpomatic {
/** @class Screen
diff --git a/src/lib/trusted_device.cc b/src/lib/trusted_device.cc
new file mode 100644
index 000000000..5849b8fd2
--- /dev/null
+++ b/src/lib/trusted_device.cc
@@ -0,0 +1,56 @@
+/*
+ Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "trusted_device.h"
+
+using std::string;
+
+TrustedDevice::TrustedDevice (string thumbprint)
+ : _thumbprint (thumbprint)
+{
+
+}
+
+TrustedDevice::TrustedDevice (dcp::Certificate certificate)
+ : _certificate (certificate)
+{
+
+}
+
+string
+TrustedDevice::as_string () const
+{
+ if (_certificate) {
+ return _certificate->certificate(true);
+ }
+
+ return *_thumbprint;
+}
+
+string
+TrustedDevice::thumbprint () const
+{
+ if (_certificate) {
+ return _certificate->thumbprint ();
+ }
+
+ return *_thumbprint;
+}
+
diff --git a/src/lib/trusted_device.h b/src/lib/trusted_device.h
new file mode 100644
index 000000000..7c6af3ea8
--- /dev/null
+++ b/src/lib/trusted_device.h
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef DCPOMATIC_TRUSTED_DEVICE_H
+#define DCPOMATIC_TRUSTED_DEVICE_H
+
+#include <dcp/certificate.h>
+#include <boost/optional.hpp>
+#include <string>
+
+class TrustedDevice
+{
+public:
+ explicit TrustedDevice (std::string);
+ explicit TrustedDevice (dcp::Certificate);
+
+ boost::optional<dcp::Certificate> certificate () const {
+ return _certificate;
+ }
+
+ std::string thumbprint () const;
+ std::string as_string () const;
+
+private:
+ boost::optional<dcp::Certificate> _certificate;
+ boost::optional<std::string> _thumbprint;
+};
+
+#endif
diff --git a/src/lib/wscript b/src/lib/wscript
index ea52079d0..f8f251cf1 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -163,6 +163,7 @@ sources = """
text_ring_buffers.cc
timer.cc
transcode_job.cc
+ trusted_device.cc
types.cc
signal_manager.cc
stdout_log.cc