mcpp index

compat.gzip-hpp

#include

gzip-hpp — header-only gzip/deflate compression wrappers over zlib

#include <gzip/compress.hpp>
mcpp add compat.gzip-hpp@0.1.0

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// Behavioral test — compat.gzip-hpp compresses and decompresses through zlib.
//
// Round-trip alone would pass on a library that did nothing, so the test also
// asserts the gzip MAGIC on the compressed bytes and that a compressible
// payload actually shrinks. Both are answers only real deflate can give.
//
// It is also the link-time proof for the package's zlib dependency: every
// function called here bottoms out in `deflate`/`inflate`.
#include <gzip/compress.hpp>
#include <gzip/decompress.hpp>
#include <gzip/utils.hpp>

#include <cstdio>
#include <string>

int main() {
    std::string original;
    for (int i = 0; i < 200; ++i) original += "mcpp-index gzip round trip ";

    const std::string compressed = gzip::compress(original.data(), original.size());

    if (!gzip::is_compressed(compressed.data(), compressed.size())) {
// …

tests/examples/gzip-hpp/tests/roundtrip.cpp · 项目 tests/examples/gzip-hpp

openkal

目标结果环境测试项目首条诊断
x86_64-linux-gnurunsposixgzip-hpp
x86_64-windows-muslrunsposixgzip-hpp

测量方式

2026-09-23 由 tests/openkal/compat.py 测得,使用 openkal-llvm-runtime 0.15.1、llvm@22.1.8、mcpp 2026.9.21.3。测试项目没有自行选择平台依赖。 上方徽章是所有已测目标里最严格那个的结果 —— 上表列出每个目标各自的环境。

构建

targets
gzip_hpp (lib)
language
c++23
C standard
c11
import std
no
include dirs
mcpp_generated, */include

源文件 (1)

  • mcpp_generated/gzip_hpp_anchor.c

生成的文件

  • mcpp_generated/gzip/utils.hpp
  • mcpp_generated/gzip/config.hpp
  • mcpp_generated/gzip_hpp_anchor.c

版本

版本平台 镜像sha256
0.1.0 最新 LinuxWindowsmacOS CN GLOBAL 7ce3908cd13f…