diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-03-16 00:44:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-06 15:57:14 +0200 |
| commit | a1f7bf2d9e5610075fbd898cdf52f4f8373741f2 (patch) | |
| tree | 5539cea37bebe3347408b9404ac3d9aa5cd5fe1b /src/lib/copy_to_drive_job.h | |
| parent | adddda49c17e87198253d9c900dcef0f5fb2e175 (diff) | |
Add disk writer tool.
Diffstat (limited to 'src/lib/copy_to_drive_job.h')
| -rw-r--r-- | src/lib/copy_to_drive_job.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/copy_to_drive_job.h b/src/lib/copy_to_drive_job.h new file mode 100644 index 000000000..1a1a99f44 --- /dev/null +++ b/src/lib/copy_to_drive_job.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019-2020 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 "cross.h" +#include "job.h" +#include "nanomsg.h" + +class CopyToDriveJob : public Job +{ +public: + CopyToDriveJob (boost::filesystem::path dcp, Drive drive, Nanomsg& nanomsg); + + std::string name () const; + std::string json_name () const; + void run (); + +private: + void count (boost::filesystem::path dir, uint64_t& total_bytes); + void copy (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_remaining, uint64_t total); + boost::filesystem::path _dcp; + Drive _drive; + Nanomsg& _nanomsg; +}; |
