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… |