folly/folly/compression/Zstd.cpp

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <folly/compression/Zstd.h>

#if FOLLY_HAVE_LIBZSTD

#include <stdexcept>
#include <string>

#include <zstd.h>

#include <folly/Conv.h>
#include <folly/Range.h>
#include <folly/ScopeGuard.h>
#include <folly/compression/CompressionContextPoolSingletons.h>
#include <folly/compression/Utils.h>

static_assert;

dataStartsWithLE;
prefixToStringLE;

usingnamespacefolly::compression::contexts;

namespace folly {
namespace compression {
namespace zstd {
namespace {

size_t zstdThrowIfError(size_t rc) {}

ZSTD_EndDirective zstdTranslateFlush(StreamCodec::FlushOp flush) {}

class ZSTDStreamCodec final : public StreamCodec {};

constexpr uint32_t kZSTDMagicLE =;

std::vector<std::string> ZSTDStreamCodec::validPrefixes() const {}

bool ZSTDStreamCodec::canUncompress(
    const IOBuf* data, Optional<uint64_t>) const {}

CodecType codecType(Options const& options) {}

ZSTDStreamCodec::ZSTDStreamCodec(Options options)
    :{}

bool ZSTDStreamCodec::doNeedsUncompressedLength() const {}

uint64_t ZSTDStreamCodec::doMaxCompressedLength(
    uint64_t uncompressedLength) const {}

Optional<uint64_t> ZSTDStreamCodec::doGetUncompressedLength(
    IOBuf const* data, Optional<uint64_t> uncompressedLength) const {}

void ZSTDStreamCodec::doResetStream() {}

void ZSTDStreamCodec::resetCCtx() {}

bool ZSTDStreamCodec::doCompressStream(
    ByteRange& input, MutableByteRange& output, StreamCodec::FlushOp flushOp) {}

void ZSTDStreamCodec::resetDCtx() {}

bool ZSTDStreamCodec::doUncompressStream(
    ByteRange& input, MutableByteRange& output, StreamCodec::FlushOp) {}

} // namespace

Options::Options(int level) :{}

void Options::set(ZSTD_cParameter param, unsigned value) {}

/* static */ void Options::freeCCtxParams(ZSTD_CCtx_params* params) {}

std::unique_ptr<Codec> getCodec(Options options) {}

std::unique_ptr<StreamCodec> getStreamCodec(Options options) {}

} // namespace zstd
} // namespace compression
} // namespace folly

#endif