-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
53 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <odr/internal/zip/zip_exceptions.hpp> | ||
|
||
namespace odr::internal::zip { | ||
|
||
MinizSaveError::MinizSaveError(mz_zip_archive &archive) { | ||
error = mz_zip_get_last_error(&archive); | ||
error_string = mz_zip_get_error_string(error); | ||
} | ||
|
||
MinizSaveError::MinizSaveError(mz_zip_error _error) : error{_error} { | ||
error_string = mz_zip_get_error_string(_error); | ||
} | ||
|
||
const char *MinizSaveError::what() const noexcept { return error_string; } | ||
|
||
} // namespace odr::internal::zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef ODR_INTERNAL_ZIP_ZIP_EXCEPTIONS_H | ||
#define ODR_INTERNAL_ZIP_ZIP_EXCEPTIONS_H | ||
|
||
#include <odr/exceptions.hpp> | ||
|
||
#include <miniz.h> | ||
|
||
namespace odr::internal::zip { | ||
|
||
struct MinizSaveError : public ZipSaveError { | ||
mz_zip_error error{mz_zip_error::MZ_ZIP_NO_ERROR}; | ||
const char *error_string{nullptr}; | ||
|
||
MinizSaveError(mz_zip_archive &archive); | ||
MinizSaveError(mz_zip_error error_code); | ||
|
||
const char *what() const noexcept override; | ||
}; | ||
|
||
} // namespace odr::internal::zip | ||
|
||
#endif // ODR_INTERNAL_ZIP_ZIP_EXCEPTIONS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters