diff options
Diffstat (limited to 'src/lib/unzipper.cc')
| -rw-r--r-- | src/lib/unzipper.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/unzipper.cc b/src/lib/unzipper.cc index f0170e7e0..8d468f24f 100644 --- a/src/lib/unzipper.cc +++ b/src/lib/unzipper.cc @@ -56,8 +56,20 @@ Unzipper::~Unzipper() } +bool +Unzipper::contains(string const& filename) const +{ + auto file = zip_fopen(_zip, filename.c_str(), 0); + bool exists = file != nullptr; + if (file) { + zip_fclose(file); + } + return exists; +} + + string -Unzipper::get(string const& filename) +Unzipper::get(string const& filename) const { auto file = zip_fopen(_zip, filename.c_str(), 0); if (!file) { |
