#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2021 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_STORAGE_COMPRESSION_LZIP_LZIPHELPER_H #define NUCLEX_STORAGE_COMPRESSION_LZIP_LZIPHELPER_H #include "Nuclex/Storage/Config.h" #if defined(NUCLEX_STORAGE_HAVE_LZIP) #ifndef NUCLEX_STORAGE_COMPRESSION_LZIP_LZLIB_H #define NUCLEX_STORAGE_COMPRESSION_LZIP_LZLIB_H #include #include #endif #include namespace Nuclex { namespace Storage { namespace Compression { namespace LZip { // ------------------------------------------------------------------------------------------- // /// Provides helper methods to deal with the LZip library class LZipHelper { /// Looks up the error message for the specified error number /// /// Error number for which the error message will be looked up /// /// The corresponding LZip error message public: static std::string GetErrorMessage(enum ::LZ_Errno lzipErrorNumber); /// Throws the appropriate exception for an error reported by the OS /// /// Error message that should be included in the exception, will be prefixed to /// the OS error message /// /// Error number returned by an LZip function public: [[noreturn]] static void ThrowExceptionForErrorNumber( const std::string &errorMessage, enum ::LZ_Errno errorNumber ); }; // ------------------------------------------------------------------------------------------- // }}}} // namespace Nuclex::Storage::Compression::LZip #endif // defined(NUCLEX_STORAGE_HAVE_LZIP) #endif // NUCLEX_STORAGE_COMPRESSION_LZIP_LZIPHELPER_H