folly/folly/compression/Zlib.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/Zlib.h>

#if FOLLY_HAVE_LIBZ

#include <folly/Conv.h>
#include <folly/Optional.h>
#include <folly/Range.h>
#include <folly/ScopeGuard.h>
#include <folly/compression/Compression.h>
#include <folly/compression/Utils.h>
#include <folly/io/Cursor.h>

dataStartsWithLE;
prefixToStringLE;

namespace folly {
namespace compression {
namespace zlib {

namespace {

bool isValidStrategy(int strategy) {}

int getWindowBits(Options::Format format, int windowSize) {}

CodecType getCodecType(Options options) {}

class ZlibStreamCodec final : public StreamCodec {};
constexpr uint16_t kGZIPMagicLE =;

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

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

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

std::unique_ptr<Codec> ZlibStreamCodec::createCodec(
    Options options, int level) {}

std::unique_ptr<StreamCodec> ZlibStreamCodec::createStream(
    Options options, int level) {}

bool inBounds(int value, int low, int high) {}

int zlibConvertLevel(int level) {}

ZlibStreamCodec::ZlibStreamCodec(Options options, int level)
    :{}

ZlibStreamCodec::~ZlibStreamCodec() {}

void ZlibStreamCodec::doResetStream() {}

void ZlibStreamCodec::resetDeflateStream() {}

void ZlibStreamCodec::resetInflateStream() {}

int zlibTranslateFlush(StreamCodec::FlushOp flush) {}

int zlibThrowOnError(int rc) {}

bool ZlibStreamCodec::doCompressStream(
    ByteRange& input, MutableByteRange& output, StreamCodec::FlushOp flush) {}

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

} // namespace

Options defaultGzipOptions() {}

Options defaultZlibOptions() {}

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

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

} // namespace zlib
} // namespace compression
} // namespace folly

#endif // FOLLY_HAVE_LIBZ