huxerui.qrcode
importQR code and barcode generation, declarative HuxerUI views, and multi-format image decoding
import huxerui.qrcode;
模块名读自上游 modules/qrcode.cppm 里的 `export module` 声明。
mcpp add huxerui.qrcode@0.1.1
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// Headless C++23 module consumer test for huxerui.qrcode.
// Verifies vendored ZXing 3.1.1 + generated Version.h compilation, QR/1D/2D
// encode-SVG-rasterize-decode round-trips, HuxerUI view construction, and
// std::invalid_argument exceptions across the module boundary.
import std;
import huxerui.qrcode;
int main() {
using namespace huxerui::qrcode;
bool ok = true;
const auto check = [&](bool cond, std::string_view label) {
if (!cond) {
std::cerr << "FAILED: " << label << '\n';
ok = false;
}
};
// 1. Format queries (out-of-line in src/codec.cpp)
check(FormatName(BarcodeFormat::QRCode) == "QR Code", "FormatName(QRCode)");
check(CanEncode(BarcodeFormat::QRCode), "CanEncode(QRCode)");
check(CanDecode(BarcodeFormat::QRCode), "CanDecode(QRCode)");
// …
tests/examples/huxerui-qrcode/tests/runtime.cpp · 项目 tests/examples/huxerui-qrcode
构建 · 上游清单
- modules
huxerui.qrcode- targets
huxerui_qrcode (lib), qrcode (lib)- language
c++23- manifest version
0.1.1- dependencies
huxerui- 来源
https://raw.githubusercontent.com/HuxerUI/Lib-QRCode/v0.1.1/mcpp.toml
版本
| 版本 | 平台 | 镜像 | sha256 |
|---|---|---|---|
0.1.1 最新 |
LinuxWindowsmacOS | 源站 | 14fb81089e30… |