v2.0.0
Loading...
Searching...
No Matches
mna_registry_loader.cpp File Reference

Implementation of the mna-registry.json manifest reader, drop-in directory merger and registry-to-manifest serialiser. More...

#include "mna_registry_loader.h"
#include "mna_op_registry.h"
#include "mna_op_schema.h"
#include "mna_types.h"
#include <QFile>
#include <QDir>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QDebug>
Include dependency graph for mna_registry_loader.cpp:

Go to the source code of this file.

Detailed Description

Implementation of the mna-registry.json manifest reader, drop-in directory merger and registry-to-manifest serialiser.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.0
Date
April 2026

MnaRegistryLoader::loadFile parses one manifest JSON, walks the ops array, deserialises each entry into a MnaOpSchema with its port and attribute lists, and calls MnaOpRegistry::registerOp; missing or malformed entries are skipped with a warning so a single broken op does not abort the load. loadDirectory loads mna-registry.json first, then every *.json file under mna-registry.d/ in alphabetical order so later files override earlier definitions, which is how plug-in packages extend or shadow built-in ops.

saveFile inverts the process: it walks every schema currently registered with MnaOpRegistry, emits the canonical manifest header (mna_registry_version, provider) and the ops array, and writes the file pretty-printed so the output remains diff-friendly under version control.

Definition in file mna_registry_loader.cpp.