v2.0.0
Loading...
Searching...
No Matches
MNALIB::MnaRegistryLoader Class Reference

Declarative MNA registry file loader. More...

#include <mna_registry_loader.h>

Static Public Member Functions

static int loadFile (const QString &path, MnaOpRegistry &registry)
static int loadDirectory (const QString &registryDir, MnaOpRegistry &registry)
static bool saveFile (const QString &path, const QString &provider, const MnaOpRegistry &registry)

Detailed Description

Declarative MNA registry file loader.

Loads MNA operation schemas from declarative JSON registry manifest files.

Registry files follow the mna-registry.json format with "mna_registry_version", "provider", and "ops" array. The loader supports a master manifest plus drop-in files from a mna-registry.d/ directory.

Definition at line 73 of file mna_registry_loader.h.

Member Function Documentation

◆ loadDirectory()

int MnaRegistryLoader::loadDirectory ( const QString & registryDir,
MnaOpRegistry & registry )
static

Load the master manifest plus all drop-in files from a directory.

Loads mna-registry.json first, then all *.json files from mna-registry.d/ in alphabetical order. Later files override earlier entries for the same op type.

Parameters
[in]registryDirDirectory containing mna-registry.json.
[in,out]registryRegistry to populate.
Returns
Total number of ops loaded across all files.

Definition at line 262 of file mna_registry_loader.cpp.

◆ loadFile()

int MnaRegistryLoader::loadFile ( const QString & path,
MnaOpRegistry & registry )
static

Load a single registry manifest file and register all ops.

Parameters
[in]pathPath to the JSON manifest file.
[in,out]registryRegistry to populate.
Returns
Number of ops successfully loaded, or -1 on file error.

Definition at line 217 of file mna_registry_loader.cpp.

◆ saveFile()

bool MnaRegistryLoader::saveFile ( const QString & path,
const QString & provider,
const MnaOpRegistry & registry )
static

Serialize current registry schemas to a JSON manifest file.

Parameters
[in]pathOutput file path.
[in]providerProvider name for the manifest header.
[in]registryRegistry to serialize.
Returns
True if writing succeeded.

Definition at line 290 of file mna_registry_loader.cpp.


The documentation for this class was generated from the following files: