mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-11-21 23:13:53 +01:00
Inherit custom exceptions from std::exception
This commit is contained in:
parent
8e9805c3ff
commit
2e353312b5
@ -1,24 +1,21 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <exception>
|
||||||
#include <string>
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
|
||||||
class ZlibDecompressor
|
class ZlibDecompressor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class DecompressError {
|
class DecompressError : std::exception {};
|
||||||
};
|
|
||||||
|
|
||||||
ZlibDecompressor(const unsigned char *data, std::size_t size);
|
ZlibDecompressor(const u8 *data, size_t size);
|
||||||
~ZlibDecompressor();
|
~ZlibDecompressor();
|
||||||
void setSeekPos(std::size_t seekPos);
|
void setSeekPos(size_t seekPos);
|
||||||
std::size_t seekPos() const;
|
size_t seekPos() const;
|
||||||
ustring decompress();
|
ustring decompress();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const unsigned char *m_data;
|
const u8 *m_data;
|
||||||
std::size_t m_seekPos;
|
size_t m_seekPos;
|
||||||
std::size_t m_size;
|
size_t m_size;
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <exception>
|
||||||
#include <string>
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
class ZstdDecompressor
|
class ZstdDecompressor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class DecompressError {};
|
class DecompressError : std::exception {};
|
||||||
|
|
||||||
ZstdDecompressor();
|
ZstdDecompressor();
|
||||||
~ZstdDecompressor();
|
~ZstdDecompressor();
|
||||||
|
Loading…
Reference in New Issue
Block a user