diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-09-14 19:50:30 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-09-14 19:50:30 +0200 |
| commit | ec4d2df1f946fdf109d13c6d49f13869f11ae95e (patch) | |
| tree | 9d77391060131b0b3d0027eadb9f3c70b17e8064 | |
| parent | 1cf163c9181708a06ab8ac207dc976e066ae91e9 (diff) | |
| download | Project-Tick-ec4d2df1f946fdf109d13c6d49f13869f11ae95e.tar.gz Project-Tick-ec4d2df1f946fdf109d13c6d49f13869f11ae95e.zip | |
Put zlib_error into its own file
| -rw-r--r-- | include/io/ozlibstream.h | 12 | ||||
| -rw-r--r-- | include/io/zlib_error.h | 17 |
2 files changed, 18 insertions, 11 deletions
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 <ostream> #include <vector> #include <zlib.h> @@ -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 <stdexcept> + +///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 |
