mcpp index

gnome.gio

import

GIO 2.82.5 — files, streams, sockets, D-Bus, GSettings and GListModel

import gnome.gio;
#include <gio/gio.h>

模組名取自本索引給這個套件寫的測試專案。

mcpp add gnome.gio@2.82.5

用法

來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。

// ⭐ THE MODULE, WHICH IS WHAT THE NAMESPACE PROMISES.
//
// In this index the namespace is the contract: `compat.xxx` is consumed with
// `#include`, an owner namespace like `gnome.xxx` exposes `import`. The test
// next to this file consumes gnome.gio through its headers; this one consumes
// the same package through its module, so both doors are checked from the
// OUTSIDE — which is what an index example is for.
//
// ⚠️ THE TWO DOORS DO NOT COMPOSE, and that is GCC's rule rather than a choice
// here. A TU that imports the module AND textually includes a glib header
// reaches <time.h> twice — once through the module's global fragment, once
// directly — and the same `struct tm` from the same file becomes two entities:
//
//     error: conflicting declaration 'struct tm'
//     note: previous declaration as 'struct tm'   (of module gnome.glib)
//
// So a consumer picks ONE route, and which one is decided by macros: a module
// cannot carry them, and glib's are half its API. Code using `G_DEFINE_TYPE`,
// `G_OBJECT` or `G_TYPE_*` takes the header route. Code using the FUNCTION API
// — most of gio, and much of glib — imports and includes nothing.
#ifdef __linux__

// …

tests/examples/gio/tests/module.cpp · 專案 tests/examples/gio

建置 · 上游資訊清單

targets
gio-2_0 (lib), gio (lib)
language
c++23
manifest version
2.82.5
dependencies
gnome, compat
來源
https://raw.githubusercontent.com/mcpplibs/glib/2.82.5/mcpp/gio/mcpp.toml

版本

版本平台 鏡像sha256
2.82.5 最新 Linux GLOBAL CN 38a175bcd889…