Implement zstd decompression

Given the size of Redfish schemas these days, it would be nice to be
able to store them on disk in a zstd format.  Unfortunately, not all
clients support zstd at this time.

This commit implements reading of zstd files from disk, as well as
decompressing zstd in the case where the client does not support zstd as
a return type.

Tested:
Implanted an artificial zstd file into the system, and observed correct
decompression both with an allow-encoding header of empty string and
zstd.

Change-Id: I8b631bb943de99002fdd6745340aec010ee591ff
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/http/zstd_decompressor.hpp b/http/zstd_decompressor.hpp
new file mode 100644
index 0000000..777a4b8
--- /dev/null
+++ b/http/zstd_decompressor.hpp
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright OpenBMC Authors
+
+#pragma once
+
+#ifdef HAVE_ZSTD
+#include <zstd.h>
+#endif
+
+#include <boost/asio/buffer.hpp>
+#include <boost/beast/core/flat_buffer.hpp>
+
+#include <optional>
+
+class ZstdDecompressor
+{
+    boost::beast::flat_buffer compressionBuf;
+
+#ifdef HAVE_ZSTD
+    ZSTD_DCtx* dctx;
+#endif
+
+  public:
+    ZstdDecompressor(const ZstdDecompressor&) = delete;
+    ZstdDecompressor(ZstdDecompressor&&) = delete;
+    ZstdDecompressor& operator=(const ZstdDecompressor&) = delete;
+    ZstdDecompressor& operator=(ZstdDecompressor&&) = delete;
+
+    ZstdDecompressor();
+    std::optional<boost::asio::const_buffer> decompress(
+        boost::asio::const_buffer buffIn);
+    ~ZstdDecompressor();
+};