Files
logos-cpp-sdk/cpp-generator/plugin_introspect.h
Dario Gabriel LipicarandClaude Opus 5 1afcf46f4d refactor(cpp-generator): merge legacy/ into the generator, dropping its dead half
`legacy/` was never a library with an API surface. Two files, 475 lines, exactly
one exported symbol — `int legacy_main(int, char**)` — with every other
definition `static`, compiled INTO logos-cpp-generator and reached by fallthrough
at the end of main(). So there was nothing to keep separate: it is one mode of
this binary, and it now lives beside the others as plugin_introspect.{cpp,h}
behind `runPluginIntrospectMode()`, named for what it does.

Deleting it was never an option — that premise was checked and refused earlier.
`--general-only` alone has ~10 live callers across 7 repos including the central
module path (buildPlugin.nix:206,211, buildHeaders.nix:221,
LogosModule.cmake:423). The mode is load-bearing; only its packaging was wrong.

110 lines go with the move, all genuinely unreferenced:

  * cppStringEscape — zero callers anywhere.
  * writeUmbrellaHeader / writeUmbrellaSource and the `if (!moduleOnly)` block
    that called them. This is the real prize: a SECOND, directory-SCRAPING
    implementation of logos_sdk.{h,cpp}, unreachable in practice because
    generate-module-headers.sh:60 always passes --module-only. generator_lib's
    deps-driven makeUmbrella*FromDeps is now the only umbrella emitter, so the
    two cannot drift.
  * a dead `QJsonDocument doc(methods);` and its commented-out use.

With the block gone, `--module-only` suppresses nothing, so the parameter and
its plumbing go too. The FLAG stays tolerated rather than rejected, because
generate-module-headers.sh passes it unconditionally — a comment at the old
parse site says so.

Verified: #default builds, and both checks pass — `generator-cli` (which
exercises the CLI surface, including --general-only) and `tests`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 16:46:09 -03:00

14 lines
586 B
C

#ifndef PLUGIN_INTROSPECT_H
#define PLUGIN_INTROSPECT_H
// The QPluginLoader-introspection mode: given a BUILT plugin, walk its
// QMetaObject and emit a consumer wrapper for it. main() falls through to this
// when its own modes do not claim the arguments.
//
// This lived in `legacy/main.cpp` behind `legacy_main()`. The directory was not
// a legacy library — it held exactly one exported symbol and one reachable
// mode — so it was merged here rather than kept as a parallel implementation.
int runPluginIntrospectMode(int argc, char* argv[]);
#endif // PLUGIN_INTROSPECT_H