summaryrefslogtreecommitdiff
path: root/src/lib/upload_destination.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-06-04 00:21:59 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-09 00:35:08 +0200
commitdebd1b7233cf56f5d79e1de0c993996e5b549a6d (patch)
tree77d7279f8951e7c365140ddbe61ea2c601dec882 /src/lib/upload_destination.h
parente67c0db714284d2eeba6be52ad075acaf002de08 (diff)
Generalise TMS upload to a single upload destination.
Diffstat (limited to 'src/lib/upload_destination.h')
-rw-r--r--src/lib/upload_destination.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/lib/upload_destination.h b/src/lib/upload_destination.h
new file mode 100644
index 000000000..6d062d172
--- /dev/null
+++ b/src/lib/upload_destination.h
@@ -0,0 +1,72 @@
+/*
+ Copyright (C) 2025 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_UPLOAD_DESTINATION_H
+#define DCPOMATIC_UPLOAD_DESTINATION_H
+
+
+#include "types.h"
+#include <libcxml/cxml.h>
+
+
+class UploadDestination
+{
+public:
+ UploadDestination(
+ std::string name_,
+ FileTransferProtocol protocol_,
+ bool passive_ftp_,
+ boost::optional<int> maximum_connections_,
+ std::string host_,
+ std::string path_,
+ std::string user_,
+ std::string password_
+ )
+ : name(name_)
+ , protocol(protocol_)
+ , passive_ftp(passive_ftp_)
+ , maximum_connections(maximum_connections_)
+ , host(host_)
+ , path(path_)
+ , user(user_)
+ , password(password_)
+ {}
+
+ UploadDestination(cxml::ConstNodePtr node);
+
+ void as_xml(xmlpp::Element* parent) const;
+
+ std::string name;
+ FileTransferProtocol protocol;
+ bool passive_ftp = true;
+ boost::optional<int> maximum_connections;
+ std::string host;
+ std::string path;
+ std::string user;
+ std::string password;
+};
+
+
+bool operator==(UploadDestination const& a, UploadDestination const& b);
+
+
+#endif
+