]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/zlibcompressed.cpp
Add move semantics to Variant
[libs/core.git] / source / io / zlibcompressed.cpp
index b3cb312ae9721666d5f860d8878d517691684ee3..8896f147bf6b1ecb038e7739a275a4a7c5732a96 100644 (file)
@@ -1,6 +1,7 @@
 #ifdef WITH_ZLIB
 #include <zlib.h>
 #endif
+#include <msp/core/except.h>
 #include "zlibcompressed.h"
 
 using namespace std;
@@ -14,7 +15,7 @@ zlib_error::zlib_error(const string &w, int c):
 #else
        runtime_error(w),
 #endif
-       code_(c)
+       m_code(c)
 { }
 
 
@@ -30,9 +31,9 @@ struct ZlibCompressed::Private
 ZlibCompressed::Private::Private()
 {
 #ifdef WITH_ZLIB
-       stream.zalloc = 0;
-       stream.zfree = 0;
-       stream.opaque = 0;
+       stream.zalloc = nullptr;
+       stream.zfree = nullptr;
+       stream.opaque = nullptr;
 #endif
 }
 
@@ -73,7 +74,7 @@ ZlibCompressed::ZlibCompressed(Base &b, Mode m, unsigned level):
        (void)buffer_size;
        (void)stream_end;
        (void)level;
-       throw zlib_error("unsupported", -1);
+       throw unsupported("ZlibCompressed");
 #endif
 }
 
@@ -96,12 +97,12 @@ ZlibCompressed::~ZlibCompressed()
 
 void ZlibCompressed::set_block(bool)
 {
-       throw logic_error("ZlibCompressed::set_block");
+       throw unsupported("ZlibCompressed::set_block");
 }
 
 void ZlibCompressed::set_inherit(bool)
 {
-       throw logic_error("ZlibCompressed::set_inherit");
+       throw unsupported("ZlibCompressed::set_inherit");
 }
 
 void ZlibCompressed::flush()
@@ -261,7 +262,7 @@ size_t ZlibCompressed::do_read(char *data, size_t size)
 
 const Handle &ZlibCompressed::get_handle(Mode)
 {
-       throw logic_error("ZlibCompressed::get_handle");
+       throw unsupported("ZlibCompressed::get_handle");
 }
 
 } // namespace IO