| 172 | operator zip_t *() const { return handle_; } |
| 173 | explicit operator bool() const { return handle_ != nullptr; } |
| 174 | int close() |
| 175 | { |
| 176 | if ( !handle_ ) |
| 177 | return 0; |
| 178 | zip_register_progress_callback_with_state( handle_, 0.001f, zipProgressCallback, nullptr, &pd_ ); |
| 179 | #if (defined(LIBZIP_VERSION_MINOR) && LIBZIP_VERSION_MINOR >= 6 ) |
| 180 | zip_register_cancel_callback_with_state( handle_, zipCancelCallback, nullptr, &pd_ ); |
| 181 | #endif |
| 182 | int res = zip_close( handle_ ); |
| 183 | handle_ = nullptr; |
| 184 | return res; |
| 185 | } |
| 186 | |
| 187 | /// Takes ownership of pre-deflated entries and registers them in the archive in order. |
| 188 | /// Entries stay alive for the AutoCloseZip's lifetime, so libzip's later zip_close (either |
no outgoing calls
no test coverage detected