diff --git a/fs_mgr/libsnapshot/libsnapshot_cow/cow_decompress.cpp b/fs_mgr/libsnapshot/libsnapshot_cow/cow_decompress.cpp index da90cc048..3692c1a8a 100644 --- a/fs_mgr/libsnapshot/libsnapshot_cow/cow_decompress.cpp +++ b/fs_mgr/libsnapshot/libsnapshot_cow/cow_decompress.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -62,6 +63,8 @@ std::unique_ptr IDecompressor::FromString(std::string_view compre return IDecompressor::Brotli(); } else if (compressor == "gz") { return IDecompressor::Gz(); + } else if (compressor == "zstd") { + return IDecompressor::Zstd(); } else { return nullptr; } @@ -211,10 +214,6 @@ bool GzDecompressor::PartialDecompress(const uint8_t* data, size_t length) { return true; } -std::unique_ptr IDecompressor::Gz() { - return std::unique_ptr(new GzDecompressor()); -} - class BrotliDecompressor final : public StreamDecompressor { public: ~BrotliDecompressor(); @@ -275,10 +274,6 @@ bool BrotliDecompressor::PartialDecompress(const uint8_t* data, size_t length) { return true; } -std::unique_ptr IDecompressor::Brotli() { - return std::unique_ptr(new BrotliDecompressor()); -} - class Lz4Decompressor final : public IDecompressor { public: ~Lz4Decompressor() override = default; @@ -382,6 +377,14 @@ class ZstdDecompressor final : public IDecompressor { } }; +std::unique_ptr IDecompressor::Brotli() { + return std::make_unique(); +} + +std::unique_ptr IDecompressor::Gz() { + return std::make_unique(); +} + std::unique_ptr IDecompressor::Lz4() { return std::make_unique(); }