aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/compression/compression.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-12-09 01:53:06 +0000
committerlloyd <[email protected]>2014-12-09 01:53:06 +0000
commit0bc9c6b170bd2c52a2fccfda12f767700bb40968 (patch)
tree5c1328b44da71c512332442e3d36989df70ef7c7 /src/lib/compression/compression.cpp
parente14d04baf0261d5250285fcb6486950078b2c6e7 (diff)
Figure out which decompressor to use based on the input file extension.
Rename Bzip to Bzip2, and split Zlib and Deflate compressors into two completely distinct types rather than using a bool flag to the Zlib constructor. Ignore null pointers to our free implementation (LZMA does this).
Diffstat (limited to 'src/lib/compression/compression.cpp')
-rw-r--r--src/lib/compression/compression.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/compression/compression.cpp b/src/lib/compression/compression.cpp
index 35b2a4bc0..191d894c4 100644
--- a/src/lib/compression/compression.cpp
+++ b/src/lib/compression/compression.cpp
@@ -11,8 +11,8 @@
#include <botan/zlib.h>
#endif
-#if defined(BOTAN_HAS_BZIP_TRANSFORM)
- #include <botan/bzip.h>
+#if defined(BOTAN_HAS_BZIP2_TRANSFORM)
+ #include <botan/bzip2.h>
#endif
#if defined(BOTAN_HAS_LZMA_TRANSFORM)
@@ -25,16 +25,16 @@ Compressor_Transformation* make_compressor(const std::string& type, size_t level
{
#if defined(BOTAN_HAS_ZLIB_TRANSFORM)
if(type == "zlib")
- return new Zlib_Compression(level, false);
+ return new Zlib_Compression(level);
if(type == "deflate")
- return new Zlib_Compression(level, true);
+ return new Deflate_Compression(level);
if(type == "gzip" || type == "gz")
return new Gzip_Compression(level);
#endif
-#if defined(BOTAN_HAS_BZIP_TRANSFORM)
+#if defined(BOTAN_HAS_BZIP2_TRANSFORM)
if(type == "bzip2" || type == "bz2")
- return new Bzip_Compression(level);
+ return new Bzip2_Compression(level);
#endif
#if defined(BOTAN_HAS_LZMA_TRANSFORM)
@@ -49,16 +49,16 @@ Compressor_Transformation* make_decompressor(const std::string& type)
{
#if defined(BOTAN_HAS_ZLIB_TRANSFORM)
if(type == "zlib")
- return new Zlib_Decompression(false);
+ return new Zlib_Decompression;
if(type == "deflate")
- return new Zlib_Decompression(true);
+ return new Deflate_Decompression;
if(type == "gzip" || type == "gz")
return new Gzip_Decompression;
#endif
-#if defined(BOTAN_HAS_BZIP_TRANSFORM)
+#if defined(BOTAN_HAS_BZIP2_TRANSFORM)
if(type == "bzip2" || type == "bz2")
- return new Bzip_Decompression;
+ return new Bzip2_Decompression;
#endif
#if defined(BOTAN_HAS_LZMA_TRANSFORM)