mcpp index

huxerui.localnetwork

import

Local network discovery, pairing, TCP/TLS transport, and Wi-Fi operations for HuxerUI

import huxerui.localnetwork;

模块名读自上游 modules/localnetwork.cppm 里的 `export module` 声明。

mcpp add huxerui.localnetwork@0.1.1

用法

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

import std;
import huxerui;
import huxerui.localnetwork;

namespace ln = huxerui::localnetwork;

namespace {

void Require(bool condition, std::string_view message) {
    if (!condition) {
        throw std::runtime_error(std::string(message));
    }
}

template <class T>
T RequireOk(ln::NetworkResult<T> result, std::string_view op) {
    if (!result.Succeeded()) {
        throw std::runtime_error(
            std::string(op) + " failed (code=" + std::to_string(static_cast<int>(result.Error().code)) +
            ", diag=" + std::to_string(result.Error().diagnostic_code) + "): " + result.Error().message);
    }
    return std::move(result).Value();
// …

tests/examples/huxerui-localnetwork/tests/localnetwork.cpp · 项目 tests/examples/huxerui-localnetwork

构建 · 上游清单

modules
huxerui.localnetwork
targets
huxerui_localnetwork (lib), localnetwork (lib)
language
c++23
manifest version
0.1.1
dependencies
huxerui, compat
来源
https://raw.githubusercontent.com/HuxerUI/Lib-LocalNetwork/v0.1.1/mcpp.toml

版本

版本平台 镜像sha256
0.1.1 最新 LinuxWindowsmacOS 源站 1258ed16fdc8…