diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-01-08 12:56:05 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-01-08 12:56:05 +0100 |
| commit | 49493f16a9bab200e50954ae69f0c7bca869a139 (patch) | |
| tree | ffb772ea6c44c2cd9f241cfed302c8a988962d54 /src/lib/zipper.cc | |
| parent | 2ac6688e4e75ff26db9208e760966bd071dcc48f (diff) | |
C++11 tidying.
Diffstat (limited to 'src/lib/zipper.cc')
| -rw-r--r-- | src/lib/zipper.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/zipper.cc b/src/lib/zipper.cc index 2c334dc94..2a0723278 100644 --- a/src/lib/zipper.cc +++ b/src/lib/zipper.cc @@ -19,17 +19,18 @@ */ -#include "zipper.h" -#include "exceptions.h" #include "dcpomatic_assert.h" +#include "exceptions.h" +#include "zipper.h" #include <zip.h> #include <boost/filesystem.hpp> #include <stdexcept> -using std::string; +using std::make_shared; using std::runtime_error; using std::shared_ptr; +using std::string; Zipper::Zipper (boost::filesystem::path file) @@ -48,7 +49,7 @@ Zipper::Zipper (boost::filesystem::path file) void Zipper::add (string name, string content) { - shared_ptr<string> copy(new string(content)); + auto copy = make_shared<string>(content); _store.push_back (copy); auto source = zip_source_buffer (_zip, copy->c_str(), copy->length(), 0); @@ -68,7 +69,7 @@ Zipper::close () if (zip_close(_zip) == -1) { throw runtime_error ("failed to close ZIP archive"); } - _zip = 0; + _zip = nullptr; } |
