Book Image

The Modern C++ Challenge

Book Image

The Modern C++ Challenge

Overview of this book

C++ is one of the most widely-used programming languages and has applications in a variety of fields, such as gaming, GUI programming, and operating systems, to name a few. Through the years, C++ has evolved into (and remains) one of the top choices for software developers worldwide. This book will show you some notable C++ features and how to implement them to meet your application needs. Each problem is unique and doesn't just test your knowledge of the language; it tests your ability to think out of the box and come up with the best solutions. With varying levels of difficulty, you'll be faced with a wide variety of challenges. And in case you're stumped, you don't have to worry: we've got the best solutions to the problems in the book. So are you up for the challenge?
Table of Contents (15 chapters)

Solutions

79. Finding files in a ZIP archive

There are a variety of libraries that provide support for working with ZIP archives. Among the ones available for free, the most used ones include ZipLib, Info-Zip, MiniZip, and LZMA SDK from 7z. And then, there are also commercial implementations. For the problems regarding ZIP archives in this book, I have chosen ZipLib. This is a lightweight, open source cross-platform C++11 library built around standard library streams, with no additional dependencies. The library, along with its documentation, is available at https://bitbucket.org/wbenny/ziplib.

To implement the required functionality, you have to:

  • Open the ZIP archive using ZipFile::Open()
  • Enumerate all the entries in the...