proxygen
ZstdStreamDecompressor.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 // We need access to zstd internals (to read frame headers etc.)
13 #ifndef ZSTD_STATIC_LINKING_ONLY
14 #define ZSTD_STATIC_LINKING_ONLY
15 #define ZDICT_STATIC_LINKING_ONLY
16 #endif
17 
18 #include <memory>
19 #include <zstd.h>
20 #include <zdict.h>
21 
22 namespace folly {
23 class IOBuf;
24 }
25 
26 namespace proxygen {
27 
28 enum class ZstdStatusType: int {
29  NONE,
30  SUCCESS,
31  NODICT,
32  CONTINUE,
33  ERROR,
34  };
35 
36 
38  public:
39  explicit ZstdStreamDecompressor(size_t, std::string);
41  std::unique_ptr<folly::IOBuf> decompress(const folly::IOBuf* in);
42  ZstdStatusType getStatus() {return status_;};
44 
45  private:
46  ZSTD_DStream *dStream_{nullptr};
47  ZSTD_DDict* dDict_{nullptr};
48  size_t totalLen_{0};
49  size_t totalDec_{0};
50 };
51 }
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
const char * string
Definition: Conv.cpp:212