rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
623 stars 113 forks source link

BitException::getErrorCode() marked as 'const' #64

Closed DymOK93 closed 2 years ago

DymOK93 commented 2 years ago

Description

BitException::getErrorCode() marked as const

Motivation and Context

Closes #63

How Has This Been Tested?

Build the following code:

// main.cpp
#include <bit7zlibrary.hpp>
#include <iostream>
#include <iomanip>

int main {
  try {
    bit7z::Bit7zLibrary lib;
  } catch (const BitException& exc) {
    std::cerr << "Unable to unpack an archive: error " << std::hex << exc.getErrorCode() << std::endl;
  }
  return 0;
}

Types of changes

Checklist:

DymOK93 commented 2 years ago

Sorry, I forgot that MSVC2012 doesn't support the noexcept specifier. Fixed with forced push.