From ec4d2df1f946fdf109d13c6d49f13869f11ae95e Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Mon, 14 Sep 2015 19:50:30 +0200 Subject: Put zlib_error into its own file --- include/io/ozlibstream.h | 12 +----------- include/io/zlib_error.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 include/io/zlib_error.h (limited to 'include') diff --git a/include/io/ozlibstream.h b/include/io/ozlibstream.h index c427281763..6ebd3c0dd0 100644 --- a/include/io/ozlibstream.h +++ b/include/io/ozlibstream.h @@ -20,6 +20,7 @@ #ifndef OZLIBSTREAM_H_INCLUDED #define OZLIBSTREAM_H_INCLUDED +#include "io/zlib_error.h" #include #include #include @@ -27,17 +28,6 @@ namespace zlib { -///Exception thrown in case zlib encounters a problem -class zlib_error : public std::runtime_error -{ -public: - const int errcode; - - explicit zlib_error(const char* what_arg, int errcode = Z_ERRNO): - std::runtime_error(what_arg), errcode(errcode) - {} -}; - /** * @brief Stream buffer used by zlib::ozlibstream * @see ozlibstream diff --git a/include/io/zlib_error.h b/include/io/zlib_error.h new file mode 100644 index 0000000000..12eaf20a3f --- /dev/null +++ b/include/io/zlib_error.h @@ -0,0 +1,17 @@ +#ifndef ZLIB_ERROR_H_INCLUDED +#define ZLIB_ERROR_H_INCLUDED + +#include + +///Exception thrown in case zlib encounters a problem +class zlib_error : public std::runtime_error +{ +public: + const int errcode; + + explicit zlib_error(const char* what_arg, int errcode = -1): + std::runtime_error(what_arg), errcode(errcode) + {} +}; + +#endif // ZLIB_ERROR_H_INCLUDED -- cgit 0.0.5-2-1-g0f52