Inherit custom exceptions from std::exception

This commit is contained in:
sfan5 2022-02-08 23:39:03 +01:00
parent 8e9805c3ff
commit 2e353312b5
2 changed files with 10 additions and 14 deletions

@ -1,24 +1,21 @@
#pragma once
#include <cstdlib>
#include <string>
#include <exception>
#include "types.h"
class ZlibDecompressor
{
public:
class DecompressError {
};
class DecompressError : std::exception {};
ZlibDecompressor(const unsigned char *data, std::size_t size);
ZlibDecompressor(const u8 *data, size_t size);
~ZlibDecompressor();
void setSeekPos(std::size_t seekPos);
std::size_t seekPos() const;
void setSeekPos(size_t seekPos);
size_t seekPos() const;
ustring decompress();
private:
const unsigned char *m_data;
std::size_t m_seekPos;
std::size_t m_size;
const u8 *m_data;
size_t m_seekPos;
size_t m_size;
};

@ -1,13 +1,12 @@
#pragma once
#include <cstdlib>
#include <string>
#include <exception>
#include "types.h"
class ZstdDecompressor
{
public:
class DecompressError {};
class DecompressError : std::exception {};
ZstdDecompressor();
~ZstdDecompressor();