diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-25 01:02:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-25 01:02:11 +0100 |
| commit | 996886d220feec5299b66bd2a3bfe916c2c7ae39 (patch) | |
| tree | 01cb3eb10562330330c73061ffd99b71389b55f5 /src/lib/zipper.cc | |
| parent | 1f3601d0f09ae33b24b5e793f0dcf57d3bff90f6 (diff) | |
White space: kdm_cli.{cc,h} usl.{cc,h} zipper.{cc,h}
Diffstat (limited to 'src/lib/zipper.cc')
| -rw-r--r-- | src/lib/zipper.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/zipper.cc b/src/lib/zipper.cc index 625f3049a..7b9d55ef4 100644 --- a/src/lib/zipper.cc +++ b/src/lib/zipper.cc @@ -33,28 +33,28 @@ using std::shared_ptr; using std::string; -Zipper::Zipper (boost::filesystem::path file) +Zipper::Zipper(boost::filesystem::path file) { int error; _zip = zip_open(dcp::filesystem::fix_long_path(file).string().c_str(), ZIP_CREATE | ZIP_EXCL, &error); if (!_zip) { if (error == ZIP_ER_EXISTS) { - throw FileError ("ZIP file already exists", file); + throw FileError("ZIP file already exists", file); } - throw FileError ("could not create ZIP file", file); + throw FileError("could not create ZIP file", file); } } void -Zipper::add (string name, string content) +Zipper::add(string name, string content) { shared_ptr<string> copy(new string(content)); - _store.push_back (copy); + _store.push_back(copy); - auto source = zip_source_buffer (_zip, copy->c_str(), copy->length(), 0); + auto source = zip_source_buffer(_zip, copy->c_str(), copy->length(), 0); if (!source) { - throw runtime_error ("could not create ZIP source"); + throw runtime_error("could not create ZIP source"); } #ifdef DCPOMATIC_HAVE_ZIP_FILE_ADD @@ -68,16 +68,16 @@ Zipper::add (string name, string content) void -Zipper::close () +Zipper::close() { if (zip_close(_zip) == -1) { - throw runtime_error ("failed to close ZIP archive"); + throw runtime_error("failed to close ZIP archive"); } _zip = 0; } -Zipper::~Zipper () +Zipper::~Zipper() { if (_zip) { zip_close(_zip); |
